Android Open Source - Lollipop-AppCompat-Widgets-Skeleton Activity1






From Project

Back to project page Lollipop-AppCompat-Widgets-Skeleton.

License

The source code is released under:

Apache License

If you think the Android project Lollipop-AppCompat-Widgets-Skeleton 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.sachinshinde.lollipopappcompatskeleton.ui.activities;
//  w ww  .  java2  s .c o m
import android.content.res.Resources;
import android.os.Bundle;
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;

import com.sachinshinde.lollipopappcompatskeleton.R;
import com.sachinshinde.lollipopappcompatskeleton.ui.adapters.SampleAdapter;
import com.sachinshinde.lollipopappcompatskeleton.ui.widgets.CallbackFragment;
import com.sachinshinde.lollipopappcompatskeleton.ui.widgets.SlidingTabLayout;


public class Activity1 extends BaseActivity implements
        CallbackFragment.Callbacks  {


    @Override
    public void onItemSelected(long id) {

    }

    @Override
    public int getSelectedFragment() {
        return BaseActivity.NAVDRAWER_ITEM_ACTIVITY1;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        ViewPager mViewPager = (ViewPager) findViewById(R.id.view_pager);
        mViewPager.setAdapter(buildAdapter());
        SlidingTabLayout mSlidingTabLayout = (SlidingTabLayout) findViewById(R.id.sliding_tabs);
        mSlidingTabLayout.setCustomTabView(R.layout.tab_indicator, android.R.id.text1);
        Resources res = getResources();
        mSlidingTabLayout.setSelectedIndicatorColors(res.getColor(R.color.tab_selected_strip));
        mSlidingTabLayout.setDistributeEvenly(true);
        mSlidingTabLayout.setViewPager(mViewPager);

    }

    private PagerAdapter buildAdapter() {
        return(new SampleAdapter(this, getSupportFragmentManager()));
    }


    @Override
    protected void onPostCreate(Bundle savedInstanceState) {
        super.onPostCreate(savedInstanceState);


    }

    @Override
    protected void onActionBarAutoShowOrHide(boolean shown) {
        super.onActionBarAutoShowOrHide(shown);
    }


    @Override
    public boolean canSwipeRefreshChildScrollUp() {
        return super.canSwipeRefreshChildScrollUp();
    }


    @Override protected int getLayoutResource() {
        return R.layout.tabs_layout;
    }

    @Override
    protected int getSelfNavDrawerItem() {
        return BaseActivity.NAVDRAWER_ITEM_ACTIVITY1;
    }
}




Java Source Code List

com.sachinshinde.lollipopappcompatskeleton.ApplicationTest.java
com.sachinshinde.lollipopappcompatskeleton.ui.activities.Activity1.java
com.sachinshinde.lollipopappcompatskeleton.ui.activities.Activity2.java
com.sachinshinde.lollipopappcompatskeleton.ui.activities.Activity3.java
com.sachinshinde.lollipopappcompatskeleton.ui.activities.BaseActivity.java
com.sachinshinde.lollipopappcompatskeleton.ui.adapters.SampleAdapter.java
com.sachinshinde.lollipopappcompatskeleton.ui.fragments.Activity1Fragment.java
com.sachinshinde.lollipopappcompatskeleton.ui.fragments.OtherFragment.java
com.sachinshinde.lollipopappcompatskeleton.ui.widgets.BezelImageView.java
com.sachinshinde.lollipopappcompatskeleton.ui.widgets.CallbackFragment.java
com.sachinshinde.lollipopappcompatskeleton.ui.widgets.DrawShadowFrameLayout.java
com.sachinshinde.lollipopappcompatskeleton.ui.widgets.MultiSwipeRefreshLayout.java
com.sachinshinde.lollipopappcompatskeleton.ui.widgets.ScrimInsetsFrameLayout.java
com.sachinshinde.lollipopappcompatskeleton.ui.widgets.ScrimInsetsScrollView.java
com.sachinshinde.lollipopappcompatskeleton.ui.widgets.SlidingTabLayout.java
com.sachinshinde.lollipopappcompatskeleton.ui.widgets.SlidingTabStrip.java
com.sachinshinde.lollipopappcompatskeleton.utils.UIUtils.java