1
0
mirror of https://github.com/nerzhul/ownCloud-SMS-App.git synced 2025-07-23 09:55:56 +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:
Loic Blot 2015-02-07 10:35:23 +01:00
parent 6af64d979a
commit 8f7a083f07
9 changed files with 32 additions and 78 deletions

View File

@ -7,8 +7,8 @@
<!-- From Android 3.0 to 5.0 -->
<uses-sdk
android:maxSdkVersion="21"
android:minSdkVersion="11"
android:targetSdkVersion="19" />
android:minSdkVersion="14"
android:targetSdkVersion="21" />
<uses-permission android:name="android.permission.READ_SMS" />
<!-- For SMS Broadcaster -->
@ -33,7 +33,7 @@
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
android:theme="@style/OcSmsTheme" >
<!-- Related to periodic sync -->
<service
@ -111,7 +111,7 @@
android:label="@string/title_activity_general_settings" >
</activity>
<activity
android:name="fr.unix_experience.owncloud_sms.activities.MainActivity"
android:name=".activities.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
@ -119,6 +119,10 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MainActivity2"
android:label="@string/title_activity_main_activity2" >
</activity>
</application>
</manifest>

View File

@ -11,6 +11,5 @@
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
# Project target.
target=android-17
android.library.reference.1=../appcompat_v7
android.library.reference.2=../Owncloud-Android-Library
target=android-21
android.library.reference.1=../Owncloud-Android-Library

View File

@ -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>

View File

@ -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>

View File

@ -5,8 +5,13 @@
AppBaseTheme from BOTH res/values/styles.xml and
res/values-v11/styles.xml on API 14+ devices.
-->
<style name="AppBaseTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- API 14 theme customizations can go here. -->
<style name="OcSmsTheme" parent="@android:style/Theme.Holo.Light.DarkActionBar">
<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>
</resources>

View File

@ -115,7 +115,7 @@
<item>https://</item>
<item>http://</item>
</string-array>
<!-- Main activity -->
<string name="ma_button_rate_us">Rate us !</string>
<string name="ma_button_thanksto">Thanks to</string>
@ -154,5 +154,6 @@
<string name="title_section2">Section 2</string>
<string name="title_section3">Section 3</string>
<string name="hello_world">Hello world!</string>
<string name="title_activity_main_activity2">MainActivity2</string>
</resources>

View File

@ -3,8 +3,8 @@
<!--
Base application theme, dependent on API level. This theme is replaced
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
res/values-vXX/styles.xml, while customizations related to
@ -16,5 +16,5 @@
<style name="AppTheme" parent="AppBaseTheme">
<!-- All customizations that are NOT specific to a particular API-level can go here. -->
</style>
</resources>

View File

@ -9,13 +9,5 @@
android:negativeButtonText="@null"
android:positiveButtonText="@null"
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>
</PreferenceScreen>

View File

@ -29,25 +29,21 @@ import java.util.List;
import java.util.Vector;
import fr.unix_experience.owncloud_sms.R;
import fr.unix_experience.owncloud_sms.R.id;
import fr.unix_experience.owncloud_sms.R.layout;
import fr.unix_experience.owncloud_sms.R.menu;
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.app.Activity;
import android.app.Fragment;
import android.app.FragmentManager;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.provider.Settings;
import android.support.v13.app.FragmentPagerAdapter;
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
public class MainActivity extends ActionBarActivity {
public class MainActivity extends Activity {
/**
* 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
* {@link android.support.v4.app.FragmentStatePagerAdapter}.
*/
MainPagerAdapter mPagerAdapter;
PagerAdapter mPagerAdapter;
/**
* 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,ThanksAndRateFragment.class.getName()));
mPagerAdapter = new MainPagerAdapter(getSupportFragmentManager(), fragments);
mPagerAdapter = new MainPagerAdapter(getFragmentManager(), fragments);
// Set up the ViewPager with the sections adapter.
mViewPager = (ViewPager) findViewById(R.id.pager);
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
* one of the sections/tabs/pages.
@ -115,12 +92,11 @@ public class MainActivity extends ActionBarActivity {
private final List<Fragment> mFragments;
public MainPagerAdapter(FragmentManager fm, List<Fragment> fragments) {
super(fm);
public MainPagerAdapter(FragmentManager fragmentManager, List<Fragment> fragments) {
super(fragmentManager);
mFragments = fragments;
}
@Override
public Fragment getItem(int position) {
// getItem is called to instantiate the fragment for the given page.
// Return a PlaceholderFragment (defined as a static inner class