mirror of
https://github.com/nerzhul/ownCloud-SMS-App.git
synced 2025-07-24 02:15:48 +00:00
Update sources for a proper support with Android 4+ instead of Android 2.1+. Also change HeaderBar style
This commit is contained in:
parent
6af64d979a
commit
8f7a083f07
@ -7,8 +7,8 @@
|
|||||||
<!-- From Android 3.0 to 5.0 -->
|
<!-- From Android 3.0 to 5.0 -->
|
||||||
<uses-sdk
|
<uses-sdk
|
||||||
android:maxSdkVersion="21"
|
android:maxSdkVersion="21"
|
||||||
android:minSdkVersion="11"
|
android:minSdkVersion="14"
|
||||||
android:targetSdkVersion="19" />
|
android:targetSdkVersion="21" />
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.READ_SMS" />
|
<uses-permission android:name="android.permission.READ_SMS" />
|
||||||
<!-- For SMS Broadcaster -->
|
<!-- For SMS Broadcaster -->
|
||||||
@ -33,7 +33,7 @@
|
|||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
android:icon="@drawable/ic_launcher"
|
android:icon="@drawable/ic_launcher"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:theme="@style/AppTheme" >
|
android:theme="@style/OcSmsTheme" >
|
||||||
|
|
||||||
<!-- Related to periodic sync -->
|
<!-- Related to periodic sync -->
|
||||||
<service
|
<service
|
||||||
@ -111,7 +111,7 @@
|
|||||||
android:label="@string/title_activity_general_settings" >
|
android:label="@string/title_activity_general_settings" >
|
||||||
</activity>
|
</activity>
|
||||||
<activity
|
<activity
|
||||||
android:name="fr.unix_experience.owncloud_sms.activities.MainActivity"
|
android:name=".activities.MainActivity"
|
||||||
android:label="@string/app_name" >
|
android:label="@string/app_name" >
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
@ -119,6 +119,10 @@
|
|||||||
<category android:name="android.intent.category.LAUNCHER" />
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
|
<activity
|
||||||
|
android:name=".MainActivity2"
|
||||||
|
android:label="@string/title_activity_main_activity2" >
|
||||||
|
</activity>
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
||||||
|
@ -11,6 +11,5 @@
|
|||||||
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
|
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
|
||||||
|
|
||||||
# Project target.
|
# Project target.
|
||||||
target=android-17
|
target=android-21
|
||||||
android.library.reference.1=../appcompat_v7
|
android.library.reference.1=../Owncloud-Android-Library
|
||||||
android.library.reference.2=../Owncloud-Android-Library
|
|
||||||
|
@ -1,12 +0,0 @@
|
|||||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
tools:context="fr.unix_experience.owncloud_sms.MainActivity" >
|
|
||||||
|
|
||||||
<item
|
|
||||||
android:id="@+id/action_settings"
|
|
||||||
android:orderInCategory="100"
|
|
||||||
android:title="@string/action_settings"
|
|
||||||
app:showAsAction="never"/>
|
|
||||||
|
|
||||||
</menu>
|
|
@ -1,11 +0,0 @@
|
|||||||
<resources>
|
|
||||||
|
|
||||||
<!--
|
|
||||||
Base application theme for API 11+. This theme completely replaces
|
|
||||||
AppBaseTheme from res/values/styles.xml on API 11+ devices.
|
|
||||||
-->
|
|
||||||
<style name="AppBaseTheme" parent="Theme.AppCompat.Light">
|
|
||||||
<!-- API 11 theme customizations can go here. -->
|
|
||||||
</style>
|
|
||||||
|
|
||||||
</resources>
|
|
@ -5,8 +5,13 @@
|
|||||||
AppBaseTheme from BOTH res/values/styles.xml and
|
AppBaseTheme from BOTH res/values/styles.xml and
|
||||||
res/values-v11/styles.xml on API 14+ devices.
|
res/values-v11/styles.xml on API 14+ devices.
|
||||||
-->
|
-->
|
||||||
<style name="AppBaseTheme" parent="Theme.AppCompat.Light.DarkActionBar">
|
<style name="OcSmsTheme" parent="@android:style/Theme.Holo.Light.DarkActionBar">
|
||||||
<!-- API 14 theme customizations can go here. -->
|
<item name="android:actionBarStyle">@style/OcSmsActionBar</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="OcSmsActionBar"
|
||||||
|
parent="@android:style/Widget.Holo.Light.ActionBar.Solid.Inverse">
|
||||||
|
<item name="android:background">#56a6cf</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -115,7 +115,7 @@
|
|||||||
<item>https://</item>
|
<item>https://</item>
|
||||||
<item>http://</item>
|
<item>http://</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
|
|
||||||
<!-- Main activity -->
|
<!-- Main activity -->
|
||||||
<string name="ma_button_rate_us">Rate us !</string>
|
<string name="ma_button_rate_us">Rate us !</string>
|
||||||
<string name="ma_button_thanksto">Thanks to</string>
|
<string name="ma_button_thanksto">Thanks to</string>
|
||||||
@ -154,5 +154,6 @@
|
|||||||
<string name="title_section2">Section 2</string>
|
<string name="title_section2">Section 2</string>
|
||||||
<string name="title_section3">Section 3</string>
|
<string name="title_section3">Section 3</string>
|
||||||
<string name="hello_world">Hello world!</string>
|
<string name="hello_world">Hello world!</string>
|
||||||
|
<string name="title_activity_main_activity2">MainActivity2</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
<!--
|
<!--
|
||||||
Base application theme, dependent on API level. This theme is replaced
|
Base application theme, dependent on API level. This theme is replaced
|
||||||
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
|
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
|
||||||
-->
|
-->
|
||||||
<style name="AppBaseTheme" parent="Theme.AppCompat.Light">
|
<style name="AppBaseTheme" parent="@android:style/Theme.Holo.Light">
|
||||||
<!--
|
<!--
|
||||||
Theme customizations available in newer API levels can go in
|
Theme customizations available in newer API levels can go in
|
||||||
res/values-vXX/styles.xml, while customizations related to
|
res/values-vXX/styles.xml, while customizations related to
|
||||||
@ -16,5 +16,5 @@
|
|||||||
<style name="AppTheme" parent="AppBaseTheme">
|
<style name="AppTheme" parent="AppBaseTheme">
|
||||||
<!-- All customizations that are NOT specific to a particular API-level can go here. -->
|
<!-- All customizations that are NOT specific to a particular API-level can go here. -->
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -9,13 +9,5 @@
|
|||||||
android:negativeButtonText="@null"
|
android:negativeButtonText="@null"
|
||||||
android:positiveButtonText="@null"
|
android:positiveButtonText="@null"
|
||||||
android:title="@string/pref_title_sync_frequency" />
|
android:title="@string/pref_title_sync_frequency" />
|
||||||
<!-- <ListPreference
|
|
||||||
android:defaultValue="60"
|
|
||||||
android:entries="@array/pref_slow_sync_frequency_titles"
|
|
||||||
android:entryValues="@array/pref_slow_sync_frequency_values"
|
|
||||||
android:key="slow_sync_frequency"
|
|
||||||
android:negativeButtonText="@null"
|
|
||||||
android:positiveButtonText="@null"
|
|
||||||
android:title="@string/pref_title_slow_sync_frequency" /> -->
|
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
</PreferenceScreen>
|
</PreferenceScreen>
|
||||||
|
@ -29,25 +29,21 @@ import java.util.List;
|
|||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
|
|
||||||
import fr.unix_experience.owncloud_sms.R;
|
import fr.unix_experience.owncloud_sms.R;
|
||||||
import fr.unix_experience.owncloud_sms.R.id;
|
import android.app.Activity;
|
||||||
import fr.unix_experience.owncloud_sms.R.layout;
|
import android.app.Fragment;
|
||||||
import fr.unix_experience.owncloud_sms.R.menu;
|
import android.app.FragmentManager;
|
||||||
import android.support.v7.app.ActionBarActivity;
|
|
||||||
import android.support.v4.app.Fragment;
|
|
||||||
import android.support.v4.app.FragmentManager;
|
|
||||||
import android.support.v4.app.FragmentPagerAdapter;
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
|
import android.support.v13.app.FragmentPagerAdapter;
|
||||||
|
import android.support.v4.view.PagerAdapter;
|
||||||
import android.support.v4.view.ViewPager;
|
import android.support.v4.view.ViewPager;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.Menu;
|
|
||||||
import android.view.MenuItem;
|
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
public class MainActivity extends ActionBarActivity {
|
public class MainActivity extends Activity {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The {@link android.support.v4.view.PagerAdapter} that will provide
|
* The {@link android.support.v4.view.PagerAdapter} that will provide
|
||||||
@ -56,7 +52,7 @@ public class MainActivity extends ActionBarActivity {
|
|||||||
* becomes too memory intensive, it may be best to switch to a
|
* becomes too memory intensive, it may be best to switch to a
|
||||||
* {@link android.support.v4.app.FragmentStatePagerAdapter}.
|
* {@link android.support.v4.app.FragmentStatePagerAdapter}.
|
||||||
*/
|
*/
|
||||||
MainPagerAdapter mPagerAdapter;
|
PagerAdapter mPagerAdapter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The {@link ViewPager} that will host the section contents.
|
* The {@link ViewPager} that will host the section contents.
|
||||||
@ -81,32 +77,13 @@ public class MainActivity extends ActionBarActivity {
|
|||||||
fragments.add(Fragment.instantiate(this,SecondTestFragment.class.getName()));
|
fragments.add(Fragment.instantiate(this,SecondTestFragment.class.getName()));
|
||||||
fragments.add(Fragment.instantiate(this,ThanksAndRateFragment.class.getName()));
|
fragments.add(Fragment.instantiate(this,ThanksAndRateFragment.class.getName()));
|
||||||
|
|
||||||
mPagerAdapter = new MainPagerAdapter(getSupportFragmentManager(), fragments);
|
mPagerAdapter = new MainPagerAdapter(getFragmentManager(), fragments);
|
||||||
|
|
||||||
// Set up the ViewPager with the sections adapter.
|
// Set up the ViewPager with the sections adapter.
|
||||||
mViewPager = (ViewPager) findViewById(R.id.pager);
|
mViewPager = (ViewPager) findViewById(R.id.pager);
|
||||||
mViewPager.setAdapter(mPagerAdapter);
|
mViewPager.setAdapter(mPagerAdapter);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onCreateOptionsMenu(Menu menu) {
|
|
||||||
// Inflate the menu; this adds items to the action bar if it is present.
|
|
||||||
getMenuInflater().inflate(R.menu.main, menu);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
|
||||||
// Handle action bar item clicks here. The action bar will
|
|
||||||
// automatically handle clicks on the Home/Up button, so long
|
|
||||||
// as you specify a parent activity in AndroidManifest.xml.
|
|
||||||
int id = item.getItemId();
|
|
||||||
if (id == R.id.action_settings) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return super.onOptionsItemSelected(item);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A {@link FragmentPagerAdapter} that returns a fragment corresponding to
|
* A {@link FragmentPagerAdapter} that returns a fragment corresponding to
|
||||||
* one of the sections/tabs/pages.
|
* one of the sections/tabs/pages.
|
||||||
@ -115,12 +92,11 @@ public class MainActivity extends ActionBarActivity {
|
|||||||
|
|
||||||
private final List<Fragment> mFragments;
|
private final List<Fragment> mFragments;
|
||||||
|
|
||||||
public MainPagerAdapter(FragmentManager fm, List<Fragment> fragments) {
|
public MainPagerAdapter(FragmentManager fragmentManager, List<Fragment> fragments) {
|
||||||
super(fm);
|
super(fragmentManager);
|
||||||
mFragments = fragments;
|
mFragments = fragments;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Fragment getItem(int position) {
|
public Fragment getItem(int position) {
|
||||||
// getItem is called to instantiate the fragment for the given page.
|
// getItem is called to instantiate the fragment for the given page.
|
||||||
// Return a PlaceholderFragment (defined as a static inner class
|
// Return a PlaceholderFragment (defined as a static inner class
|
||||||
|
Loading…
x
Reference in New Issue
Block a user