Android Open Source - notify-me-android Main Activity






From Project

Back to project page notify-me-android.

License

The source code is released under:

MIT License

If you think the Android project notify-me-android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.contexthub.notifyme;
//from w  ww .  ja  va  2s  . c o  m
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.view.ViewPager;
import android.support.v7.app.ActionBarActivity;
import android.view.Window;

import com.astuetz.PagerSlidingTabStrip;
import com.contexthub.notifyme.fragments.AboutFragment;
import com.contexthub.notifyme.fragments.DeviceFragment;
import com.contexthub.notifyme.fragments.PushReceiveFragment;
import com.contexthub.notifyme.fragments.PushSendFragment;

import butterknife.ButterKnife;
import butterknife.InjectView;


public class MainActivity extends ActionBarActivity {

    @InjectView(R.id.tab_strip) PagerSlidingTabStrip tabStrip;
    @InjectView(R.id.view_pager) ViewPager viewPager;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        ButterKnife.inject(this);
        viewPager.setAdapter(new PagerAdapter(getSupportFragmentManager()));
        viewPager.setOffscreenPageLimit(3);
        tabStrip.setViewPager(viewPager);
    }

    class PagerAdapter extends FragmentPagerAdapter {

        private final int[] TITLES = new int[]{R.string.send, R.string.receive, R.string.device, R.string.about};

        public PagerAdapter(FragmentManager fm) {
            super(fm);
        }

        @Override
        public CharSequence getPageTitle(int position) {
            return getString(TITLES[position]);
        }

        @Override
        public Fragment getItem(int position) {
            switch (position) {
                case 0:
                    return new PushSendFragment();
                case 1:
                    return new PushReceiveFragment();
                case 2:
                    return new DeviceFragment();
                case 3:
                    return new AboutFragment();
            }
            return null;
        }

        @Override
        public int getCount() {
            return TITLES.length;
        }
    }
}




Java Source Code List

com.contexthub.notifyme.ApplicationTest.java
com.contexthub.notifyme.Constants.java
com.contexthub.notifyme.MainActivity.java
com.contexthub.notifyme.NotifyMeApp.java
com.contexthub.notifyme.fragments.AboutFragment.java
com.contexthub.notifyme.fragments.DeviceFragment.java
com.contexthub.notifyme.fragments.PushReceiveFragment.java
com.contexthub.notifyme.fragments.PushSendFragment.java
com.contexthub.notifyme.model.CustomData.java
com.contexthub.notifyme.model.PushNotificationHistory.java
com.contexthub.notifyme.model.ReceivedPushNotification.java
com.contexthub.notifyme.push.NotificationHandler.java
com.contexthub.notifyme.widget.ClipboardTextView.java