Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package in.hopscotch.android.activity.parent;
- import android.app.SearchManager;
- import android.content.BroadcastReceiver;
- import android.content.Context;
- import android.content.Intent;
- import android.content.IntentFilter;
- import android.graphics.Color;
- import android.os.Build;
- import android.os.Bundle;
- import android.support.v4.app.Fragment;
- import android.support.v4.app.FragmentManager;
- import android.support.v4.app.FragmentTransaction;
- import android.support.v4.content.LocalBroadcastManager;
- import android.support.v7.app.ActionBar;
- import android.support.v7.widget.SearchView;
- import android.support.v7.widget.Toolbar;
- import android.text.TextUtils;
- import android.util.Log;
- import android.util.TypedValue;
- import android.view.Gravity;
- import android.view.Menu;
- import android.view.MenuItem;
- import android.view.View;
- import android.view.ViewGroup;
- import android.widget.FrameLayout;
- import android.widget.LinearLayout;
- import android.widget.TextView;
- import com.aurelhubert.ahbottomnavigation.AHBottomNavigation;
- import com.aurelhubert.ahbottomnavigation.AHBottomNavigationItem;
- import com.crashlytics.android.Crashlytics;
- import com.shamanland.fonticon.FontIconDrawable;
- import com.shamanland.fonticon.FontIconView;
- import java.util.ArrayList;
- import java.util.List;
- import in.hopscotch.android.R;
- import in.hopscotch.android.activity.HomePageActivity;
- import in.hopscotch.android.activity.JoinActivity;
- import in.hopscotch.android.activity.ProductDetailPageActivity;
- import in.hopscotch.android.activity.ProductListPageActivity;
- import in.hopscotch.android.activity.SearchResultsShowingBoutiquesActivity;
- import in.hopscotch.android.activity.ShoppingCartActivity;
- import in.hopscotch.android.activity.base.BaseActivity;
- import in.hopscotch.android.application.CartData;
- import in.hopscotch.android.application.IntentHelper;
- import in.hopscotch.android.fragment.AboutMeFragment;
- import in.hopscotch.android.fragment.BoutiquesFragment;
- import in.hopscotch.android.fragment.HomeSearchFragment;
- import in.hopscotch.android.fragment.RecentlyFragment;
- import in.hopscotch.android.fragment.ShopForFragment;
- import in.hopscotch.android.fragment.base.SlidingTabsColorsFragment;
- import in.hopscotch.android.model.UserStatus;
- import in.hopscotch.android.util.AnimationUtil;
- import in.hopscotch.android.util.Constants;
- import in.hopscotch.android.util.Util;
- import in.hopscotch.android.widget.CircleCartButton;
- import in.hopscotch.android.widget.CustomTextView;
- /**
- * Created by Anil Chahal on 12/05/2016.
- *
- * @author Anil Chahal
- */
- public class BottombarNavigationActivity extends BaseActivity {
- protected final String BOTTOM_NAVIGATION_ITEM = "bottom_navigation_item";
- protected Toolbar mToolbar;
- protected ActionBar actionBar;
- protected View mContent;
- protected MenuItem recentItem, searchItemField;
- protected CircleCartButton mFloatingButton;
- protected FrameLayout mMainLayout, mBlankLayout, mRecentlyViewLayout, mWholeContainer;
- protected LinearLayout toolbarContainer;
- private LinearLayout alertLayout;
- private TextView alertText;
- private FontIconView alertClose;
- private String currentSelectedRowClassName;
- public SearchView searchView;
- private Fragment tabFragment;
- protected ArrayList<AHBottomNavigationItem> bottomNavigationItems = new ArrayList<>();
- public AHBottomNavigation bottomNavigation;
- protected FragmentManager fragmentManager = getSupportFragmentManager();
- protected List<Fragment> mTabsFragments = new ArrayList<>();
- private BottomNavigationBarClickListener mListener;
- private final BroadcastReceiver mCartUpdateBroadcastReceiver = new BroadcastReceiver() {
- @Override
- public void onReceive(Context context, Intent intent) {
- if (intent.getAction() != null && intent.getAction()
- .equals(CartData.ACTION_CART_QUANTITY)) {
- Log.d("TAG", "QTY: " + intent
- .getIntExtra(CartData.QUANTITY, CartData.getCartQuantity()));
- if (bottomNavigation != null) {
- bottomNavigation.setNotification(CartData.getCartQuantity(), Constants.CART_TAB);
- }
- }
- }
- };
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_bottombar_navigation);
- currentSelectedRowClassName =
- getIntent().getStringExtra(IntentHelper.DRAWER_CURRENT_CLASS_NAME);
- if (currentSelectedRowClassName == null) {
- currentSelectedRowClassName = "";
- }
- mWholeContainer = (FrameLayout) findViewById(R.id.wholeContainer);
- toolbarContainer = (LinearLayout) findViewById(R.id.toolbarContainer);
- mToolbar = (Toolbar) findViewById(R.id.toolbar);
- if (mToolbar != null) {
- setSupportActionBar(mToolbar);
- actionBar = getSupportActionBar();
- }
- IntentFilter myIntentFilter = new IntentFilter();
- myIntentFilter.addAction(CartData.ACTION_CART_QUANTITY);
- LocalBroadcastManager.getInstance(getApplicationContext())
- .registerReceiver(mCartUpdateBroadcastReceiver, myIntentFilter);
- LinearLayout.LayoutParams linearLayoutParams = new LinearLayout.LayoutParams(
- ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
- linearLayoutParams.height = getSupportActionBar().getHeight() - Util.convertDpToPixel(this, 9);
- mToolbar.setLayoutParams(linearLayoutParams);
- mContent = findViewById(R.id.mainArea);
- mMainLayout = (FrameLayout) findViewById(R.id.mainLayout);
- mBlankLayout = (FrameLayout) findViewById(R.id.emptyLayout);
- mRecentlyViewLayout = (FrameLayout) findViewById(R.id.recently_viewed_container);
- alertLayout = (LinearLayout) findViewById(R.id.alertLayout);
- alertText = (TextView) findViewById(R.id.alertText);
- alertClose = (FontIconView) findViewById(R.id.alertClose);
- alertClose.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- AnimationUtil.collapse(alertLayout);
- }
- });
- mFloatingButton = (CircleCartButton) findViewById(R.id.floatingButton);
- if (actionBar != null) {
- if (!TextUtils.isEmpty(getIntent().getStringExtra(IntentHelper.INTENT_EXTRA_TITLE))) {
- actionBar.setTitle(Util.getSpannableWithCustomFont(
- this, getIntent().getStringExtra(IntentHelper.INTENT_EXTRA_TITLE)));
- } else {
- actionBar.setTitle(Util.getSpannableWithCustomFont(
- this, getString(R.string.app_name)));
- }
- }
- setUpBottomNavBar();
- }
- public void setUpBottomNavBar() {
- bottomNavigation = (AHBottomNavigation) findViewById(R.id.bottom_navigation);
- AHBottomNavigationItem discoverBar = new AHBottomNavigationItem("Home",
- FontIconDrawable.inflate(this, R.xml.bottom_home_tab),
- getResources().getColor(R.color.button_gray));
- AHBottomNavigationItem categoryBar = new AHBottomNavigationItem("Category",
- FontIconDrawable.inflate(this, R.xml.bottom_category_tab),
- getResources().getColor(R.color.button_gray));
- AHBottomNavigationItem searchBar = new AHBottomNavigationItem("Search",
- FontIconDrawable.inflate(this, R.xml.bottom_search_tab),
- getResources().getColor(R.color.button_gray));
- AHBottomNavigationItem meBar = new AHBottomNavigationItem("Me",
- FontIconDrawable.inflate(this, R.xml.bottom_me_tab),
- getResources().getColor(R.color.button_gray));
- AHBottomNavigationItem cartBar = new AHBottomNavigationItem("Cart",
- FontIconDrawable.inflate(this, R.xml.bottom_cart_tab),
- getResources().getColor(R.color.button_gray));
- bottomNavigationItems.add(discoverBar);
- bottomNavigationItems.add(categoryBar);
- bottomNavigationItems.add(searchBar);
- bottomNavigationItems.add(meBar);
- bottomNavigationItems.add(cartBar);
- bottomNavigation.addItems(bottomNavigationItems);
- bottomNavigation.setAccentColor(Color.parseColor("#FF6299"));
- bottomNavigation.setInactiveColor(Color.parseColor("#747474"));
- bottomNavigation.setNotificationBackgroundColor(Color.parseColor("#FF6299"));
- bottomNavigation.setColored(false);
- bottomNavigation.setForceTint(true);
- bottomNavigation.setUseElevation(false);
- bottomNavigation.setForceTitlesDisplay(true);
- bottomNavigation.setOnTabSelectedListener(new AHBottomNavigation.OnTabSelectedListener() {
- @Override
- public void onTabSelected(int position, boolean wasSelected) {
- switch (position) {
- case Constants.HOME_TAB:
- showHideMenuItems(position);
- setActionBarTitle(Util.getActionBarTitleName(BottombarNavigationActivity.this,
- position));
- if (BottombarNavigationActivity.this instanceof
- ProductListPageActivity) {
- smoothFinishofActivity(position);
- }
- if (BottombarNavigationActivity.this instanceof
- SearchResultsShowingBoutiquesActivity) {
- smoothFinishofActivity(position);
- }
- break;
- case Constants.CATEGORY_TAB:
- showHideMenuItems(position);
- setActionBarTitle(Util.getActionBarTitleName(BottombarNavigationActivity.this,
- position));
- if (BottombarNavigationActivity.this instanceof
- ProductListPageActivity) {
- smoothFinishofActivity(position);
- }
- if (BottombarNavigationActivity.this instanceof
- SearchResultsShowingBoutiquesActivity) {
- smoothFinishofActivity(position);
- }
- break;
- case Constants.SEARCH_TAB:
- showHideMenuItems(position);
- if (BottombarNavigationActivity.this instanceof
- ProductListPageActivity) {
- smoothFinishofActivity(position);
- }
- if (BottombarNavigationActivity.this instanceof
- SearchResultsShowingBoutiquesActivity) {
- smoothFinishofActivity(position);
- }
- break;
- case Constants.ME_TAB:
- showHideMenuItems(position);
- setActionBarTitle(Util.getActionBarTitleName(BottombarNavigationActivity.this,
- position));
- if (BottombarNavigationActivity.this instanceof
- ProductListPageActivity) {
- smoothFinishofActivity(position);
- }
- if (BottombarNavigationActivity.this instanceof
- SearchResultsShowingBoutiquesActivity) {
- smoothFinishofActivity(position);
- }
- break;
- case Constants.CART_TAB:
- showHideMenuItems(position);
- Util.inVokeShoppingCart(BottombarNavigationActivity.this,
- (BottombarNavigationActivity.this instanceof HomePageActivity));
- if (BottombarNavigationActivity.this instanceof
- ProductListPageActivity) {
- smoothFinishofActivity(position);
- }
- if (BottombarNavigationActivity.this instanceof
- SearchResultsShowingBoutiquesActivity) {
- smoothFinishofActivity(position);
- }
- return;
- default:
- break;
- }
- Fragment requestedFragment = mTabsFragments.get(position);
- if (wasSelected && requestedFragment instanceof AboutMeFragment) {
- //((AboutMeFragment) requestedFragment).goOnTop();
- return;
- } else if (wasSelected && requestedFragment instanceof BoutiquesFragment) {
- //((BoutiquesFragment) requestedFragment).goOnTop();
- return;
- }
- setCurrentItem(position);
- }
- });
- mTabsFragments.add(new BoutiquesFragment.BoutiqueTab(getString(R.string.Bestsellers),
- Color.WHITE).createFragment());
- mTabsFragments.add(new ShopForFragment());
- mTabsFragments.add(new HomeSearchFragment());
- mTabsFragments.add(new AboutMeFragment());
- mTabsFragments.add(new Fragment());
- boolean firstTabToBeAdded = true;
- Intent intent = getIntent();
- if (intent != null) {
- int position = intent.getIntExtra(IntentHelper.HOME_TAB, -1);
- if (position != -1 && position > Constants.HOME_TAB) {
- firstTabToBeAdded = false;
- setCurrentItem(position);
- }
- }
- if (this instanceof HomePageActivity && firstTabToBeAdded) {
- setActionBarTitle(Util.getActionBarTitleName(
- BottombarNavigationActivity.this, Constants.HOME_TAB));
- fragmentManager.beginTransaction()
- .replace(R.id.wholeContainer, mTabsFragments.get(Constants.HOME_TAB), "" + Constants.HOME_TAB)
- .setCustomAnimations(R.anim.bottom_navigation_bar_fade_in,
- R.anim.bottom_navigation_bar_fade_out)
- .commit();
- }
- }
- @Override
- public boolean onCreateOptionsMenu(Menu menu) {
- getMenuInflater().inflate(R.menu.include_recently_viewed, menu);
- recentItem = menu.findItem(R.id.actionbar_recently_viewed);
- recentItem.getActionView().setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- onOptionsItemSelected(recentItem);
- }
- });
- getMenuInflater().inflate(R.menu.include_search_field, menu);
- searchItemField = menu.findItem(R.id.actionbar_search_field);
- // Associate searchable configuration with the SearchView
- SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE);
- searchView = (SearchView) searchItemField.getActionView();
- searchView.setIconified(true);
- searchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName()));
- searchView.setOnSearchClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- bottomNavigation.hideBottomNavigation();
- }
- });
- TextView searchText = (TextView) searchView.findViewById(
- android.support.v7.appcompat.R.id.search_src_text);
- searchText.setOnFocusChangeListener(new View.OnFocusChangeListener() {
- @Override
- public void onFocusChange(View v, boolean hasFocus) {
- if (hasFocus) {
- bottomNavigation.hideBottomNavigation();
- } else {
- bottomNavigation.restoreBottomNavigation(true);
- }
- }
- });
- if (BottombarNavigationActivity.this instanceof ShoppingCartActivity ||
- BottombarNavigationActivity.this instanceof ProductListPageActivity ||
- BottombarNavigationActivity.this instanceof ProductDetailPageActivity ||
- BottombarNavigationActivity.this instanceof JoinActivity) {
- showHideMenuItems(Constants.CART_TAB);
- } else {
- showHideMenuItems(bottomNavigation.getCurrentItem());
- }
- return super.onCreateOptionsMenu(menu);
- }
- @Override
- public boolean onOptionsItemSelected(MenuItem item) {
- boolean ret = true;
- switch (item.getItemId()) {
- case R.id.actionbar_recently_viewed:
- if(!UserStatus.getInstance().getLoginStatus()) {
- Intent intent = IntentHelper.createIntent(this, JoinActivity.class);
- intent.putExtra(IntentHelper.INTENT_EXTRA_FLAG, JoinActivity.LOGIN_FLAG_GO);
- intent.putExtra(IntentHelper.INTENT_FLAG_SIGN_ACTION,
- Constants.FROM_RECENTLY_VIEWED);
- startActivity(intent);
- }
- else {
- if (tabFragment != null && tabFragment.isAdded()) {
- return true;
- }
- showRecentlyView();
- }
- ret = true;
- break;
- case R.id.actionbar_search_field:
- bottomNavigation.hideBottomNavigation();
- break;
- default:
- ret = super.onOptionsItemSelected(item);
- }
- return ret;
- }
- private void showHideMenuItems(int position){
- if (recentItem == null || searchItemField == null) {
- return;
- }
- if (position == Constants.SEARCH_TAB) {
- recentItem.setVisible(false);
- searchItemField.setVisible(true);
- setActionBarTitle("");
- } else if (position == Constants.CART_TAB || position == Constants.ME_TAB ||
- position == Constants.CATEGORY_TAB){
- recentItem.setVisible(false);
- searchItemField.setVisible(false);
- } else {
- recentItem.setVisible(true);
- searchItemField.setVisible(false);
- setActionBarTitle(Util.getActionBarTitleName(
- BottombarNavigationActivity.this, Constants.HOME_TAB));
- bottomNavigation.restoreBottomNavigation(true);
- }
- }
- @Override
- public void onNewIntent(Intent newIntent) {
- super.onNewIntent(newIntent);
- }
- @Override
- protected void onResume() {
- super.onResume();
- CartData.resumeCartQuantity(this);
- if (BottombarNavigationActivity.this instanceof SearchResultsShowingBoutiquesActivity &&
- Util.getKillSearchResultsBoutiquesActivity()) {
- BottombarNavigationActivity.this.finish();
- Util.setKillSearchResultsBoutiquesActivity(false);
- }
- }
- public void setActionBarTitle(String title) {
- if (actionBar != null) {
- actionBar.setTitle(Util.getSpannableWithCustomFont(this, title));
- }
- }
- protected void setActionBarSubTitle(String subTitle) {
- if (actionBar != null) {
- Util.setSubTitle(this, actionBar, subTitle);
- }
- }
- protected String getLoginStatus(){
- if (UserStatus.getInstance().getLoginStatus()) {
- return UserStatus.getInstance().getFirstName() + " " +
- UserStatus.getInstance().getLastName();
- } else {
- return getResources().getString(R.string.hello_there);
- }
- }
- protected String getActionBarTitle() {
- return actionBar.getTitle().toString();
- }
- public Toolbar getToolbar() {
- return mToolbar;
- }
- public int getToolbarHeight() {
- return toolbarContainer.getHeight();
- }
- public LinearLayout getToolbarContainer() {
- return toolbarContainer;
- }
- public int getMainContentHeight() {
- // mMainLayout' height is variable, so we use the blank layout.
- return mBlankLayout.getHeight();
- }
- public int getWholeContentHeight() {
- return mWholeContainer.getHeight();
- }
- public void removeContentMargin() {
- ((FrameLayout.LayoutParams) mContent.getLayoutParams()).setMargins(0, 0, 0, 0);
- }
- protected void setBottomNavigationBarClickListener(BottomNavigationBarClickListener listener) {
- mListener = listener;
- }
- public interface BottomNavigationBarClickListener {
- }
- @Override
- public void dismissProgress() {
- if (mBlankLayout.getVisibility() == View.VISIBLE) {
- mBlankLayout.setVisibility(View.GONE);
- }
- super.dismissProgress();
- }
- public void showAlertWindow(String message) {
- final LinearLayout linearLayout = new LinearLayout(this);
- linearLayout
- .setLayoutParams(new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
- ViewGroup.LayoutParams.WRAP_CONTENT));
- linearLayout.setOrientation(LinearLayout.VERTICAL);
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
- linearLayout.setElevation(getResources().getDimension(R.dimen.standard_padding));
- }
- linearLayout
- .setPadding(getResources().getDimensionPixelSize(R.dimen.alertWindowLeftPadding),
- getResources().getDimensionPixelSize(R.dimen.alertWindowTopPadding),
- getResources().getDimensionPixelSize(R.dimen.alertWindowLeftPadding),
- getResources().getDimensionPixelSize(R.dimen.alertWindowBottomPadding));
- linearLayout.setGravity(Gravity.CENTER_HORIZONTAL);
- linearLayout.setBackgroundColor(getResources().getColor(R.color.red));
- FontIconView fontIconView = new FontIconView(this);
- fontIconView
- .setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,
- ViewGroup.LayoutParams.WRAP_CONTENT));
- fontIconView.setTextColor(getResources().getColor(R.color.white));
- fontIconView.setTextSize(TypedValue.COMPLEX_UNIT_PX, getResources()
- .getDimensionPixelSize(R.dimen.title_text_size));
- fontIconView.setText(R.string.icon_error);
- linearLayout.addView(fontIconView);
- CustomTextView textView = new CustomTextView(this);
- textView.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
- ViewGroup.LayoutParams.MATCH_PARENT));
- textView.setTextColor(getResources().getColor(R.color.white));
- textView.setTextSize(TypedValue.COMPLEX_UNIT_PX, getResources()
- .getDimensionPixelSize(R.dimen.verificationStatusTextSize));
- textView.setPadding(0, getResources().getDimensionPixelSize(R.dimen.standard_padding), 0,
- 0);
- textView.setText(message);
- textView.setGravity(Gravity.CENTER);
- textView.setSingleLine(false);
- textView.setLines(2);
- linearLayout.addView(textView);
- linearLayout.setVisibility(View.VISIBLE);
- mWholeContainer.addView(linearLayout);
- AnimationUtil.expandView(linearLayout);
- mWholeContainer.postDelayed(new Runnable() {
- @Override
- public void run() {
- AnimationUtil.collapse(linearLayout);
- mWholeContainer.removeView(linearLayout);
- }
- }, 3000);
- }
- public void showAlertWindowWithCloseBtn(String message, int color) {
- alertText.setText(message);
- alertLayout.setBackgroundColor(getResources().getColor(color));
- AnimationUtil.expandView(alertLayout);
- }
- @Override
- public void offline() {
- showAlertWindowWithCloseBtn(getString(R.string.no_internet_alert), R.color.red);
- }
- @Override
- public void online() {
- AnimationUtil.collapse(alertLayout);
- }
- protected void setCurrentItem(int position) {
- FragmentTransaction ft = fragmentManager.beginTransaction();
- Fragment prevFragment = fragmentManager.findFragmentByTag("" + position);
- if (prevFragment == null) {
- ft.add(R.id.wholeContainer, mTabsFragments.get(position), "" + position).commit();
- }
- ft = fragmentManager.beginTransaction();
- for (int i = 0; i < mTabsFragments.size(); i++) {
- if (i == position) {
- ft.show(mTabsFragments.get(i));
- } else {
- ft.hide(mTabsFragments.get(i));
- }
- }
- ft.commit();
- if (bottomNavigation.getCurrentItem() != position) {
- bottomNavigation.setCurrentItem(position, false);
- }
- showHideMenuItems(position);
- }
- @Override
- protected void onDestroy() {
- LocalBroadcastManager.getInstance(
- getApplicationContext()).unregisterReceiver(mCartUpdateBroadcastReceiver);
- if (bottomNavigationItems != null) {
- bottomNavigationItems.clear();
- bottomNavigationItems = null;
- }
- if (mTabsFragments != null) {
- for (Fragment fragment : mTabsFragments) {
- FragmentTransaction ft = fragmentManager.beginTransaction();
- ft.remove(fragment).commitAllowingStateLoss();
- }
- mTabsFragments.clear();
- mTabsFragments = null;
- }
- super.onDestroy();
- }
- public void hideBottomNavigationBar() {
- if (bottomNavigation != null) {
- bottomNavigation.hideBottomNavigation();
- }
- }
- public void restoreBottomNavigationBar(boolean withAnimation) {
- if (bottomNavigation != null) {
- bottomNavigation.restoreBottomNavigation(withAnimation);
- }
- }
- private void showRecentlyView() {
- try {
- mRecentlyViewLayout.setVisibility(View.VISIBLE);
- FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
- ft.setCustomAnimations(R.anim.abc_slide_in_bottom, R.anim.abc_slide_out_bottom,
- R.anim.abc_slide_in_bottom,
- R.anim.abc_slide_out_bottom);
- if (tabFragment == null) {
- prepareRecentlyView();
- ft.add(R.id.recently_viewed_container, tabFragment, SlidingTabsColorsFragment.TAG);
- } else {
- ft.attach(tabFragment);
- }
- ft.commit();
- getSupportFragmentManager().executePendingTransactions();
- toolbarContainer.setVisibility(View.GONE);
- Util.setStaueBarColor(this, getResources().getColor(R.color.navy_dark));
- } catch (IllegalStateException e) {
- e.printStackTrace();
- Crashlytics.logException(e);
- }
- }
- private void prepareRecentlyView() {
- tabFragment = getSupportFragmentManager()
- .findFragmentByTag(SlidingTabsColorsFragment.TAG);
- if (tabFragment == null) {
- ArrayList<RecentlyFragment.RecentlyViewTab> tabs = new ArrayList<>();
- tabs.add(new RecentlyFragment.RecentlyViewTab(getString(R.string.boutiques),
- getResources().getColor(R.color.white), false));
- tabs.add(new RecentlyFragment.RecentlyViewTab(getString(R.string.products),
- getResources().getColor(R.color.white), true));
- tabFragment = SlidingTabsColorsFragment.newInstance(tabs, R.layout.weight_tab_textview,
- R.id.textView3);
- }
- }
- private void smoothFinishofActivity(int position) {
- setActionBarTitle("");
- setActionBarSubTitle("");
- actionBar.setDisplayHomeAsUpEnabled(false);
- Util.setSelectedBar(position);
- BottombarNavigationActivity.this.finish();
- overridePendingTransition(0, R.anim.face_out);
- Util.setKillSearchResultsBoutiquesActivity(true);
- }
- }
Add Comment
Please, Sign In to add comment