mirror of
https://github.com/nerzhul/ownCloud-SMS-App.git
synced 2026-08-22 05:43:05 +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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user