2019-04-02 17:41:53 +08:00
|
|
|
|
package com.novelbook.android;
|
|
|
|
|
|
|
|
|
|
import android.app.SearchManager;
|
|
|
|
|
import android.content.Context;
|
|
|
|
|
import android.content.Intent;
|
|
|
|
|
import android.os.Bundle;
|
|
|
|
|
import android.support.annotation.NonNull;
|
|
|
|
|
import android.support.design.widget.BottomNavigationView;
|
|
|
|
|
import android.support.v4.app.Fragment;
|
|
|
|
|
import android.support.v4.app.FragmentManager;
|
|
|
|
|
import android.support.v4.app.FragmentTransaction;
|
|
|
|
|
import android.support.v7.widget.AppCompatSpinner;
|
|
|
|
|
import android.support.v7.widget.SearchView;
|
|
|
|
|
import android.util.Log;
|
|
|
|
|
import android.view.KeyEvent;
|
|
|
|
|
import android.view.View;
|
|
|
|
|
import android.support.design.widget.NavigationView;
|
|
|
|
|
import android.support.v4.view.GravityCompat;
|
|
|
|
|
import android.support.v4.widget.DrawerLayout;
|
|
|
|
|
import android.support.v7.app.ActionBarDrawerToggle;
|
|
|
|
|
import android.support.v7.app.AppCompatActivity;
|
|
|
|
|
import android.support.v7.widget.Toolbar;
|
|
|
|
|
import android.view.Menu;
|
|
|
|
|
import android.view.MenuItem;
|
2019-04-14 23:17:31 +08:00
|
|
|
|
import android.widget.RadioGroup;
|
2019-04-02 17:41:53 +08:00
|
|
|
|
import android.widget.TextView;
|
|
|
|
|
import android.widget.Toast;
|
|
|
|
|
|
2019-04-14 23:17:31 +08:00
|
|
|
|
import com.novelbook.android.Fragments.BasicFragment;
|
2019-04-02 17:41:53 +08:00
|
|
|
|
import com.novelbook.android.Fragments.Fragment_Shelf;
|
|
|
|
|
import com.novelbook.android.Fragments.Fragment_bookStore;
|
|
|
|
|
import com.novelbook.android.Fragments.Fragment_paihang;
|
2019-04-14 23:17:31 +08:00
|
|
|
|
import com.novelbook.android.utils.Constants;
|
2019-04-02 17:41:53 +08:00
|
|
|
|
|
2019-04-12 23:02:31 +08:00
|
|
|
|
|
2019-04-14 23:17:31 +08:00
|
|
|
|
import org.litepal.util.Const;
|
2019-04-02 17:41:53 +08:00
|
|
|
|
|
|
|
|
|
import butterknife.BindView;
|
|
|
|
|
import butterknife.ButterKnife;
|
2019-04-14 23:17:31 +08:00
|
|
|
|
import butterknife.OnCheckedChanged;
|
|
|
|
|
import butterknife.OnClick;
|
|
|
|
|
|
2019-04-10 22:19:06 +08:00
|
|
|
|
public class Main2Activity extends Activity_base
|
2019-04-02 17:41:53 +08:00
|
|
|
|
implements NavigationView.OnNavigationItemSelectedListener{//} , BasicFragment.OnFragmentInteractionListener {
|
|
|
|
|
public MyApp app ;
|
|
|
|
|
public static String TAG ="com.novelbook.android.Main2Activity";
|
|
|
|
|
@BindView(R.id.toolbar)
|
|
|
|
|
Toolbar toolbar;
|
|
|
|
|
// @BindView(R.id.fab)
|
|
|
|
|
// FloatingActionButton fab ;
|
|
|
|
|
@BindView(R.id.nav_view )
|
|
|
|
|
NavigationView navigationView;
|
|
|
|
|
@BindView(R.id.navigation )
|
|
|
|
|
BottomNavigationView botoomNavigation;
|
2019-04-14 23:17:31 +08:00
|
|
|
|
@BindView(R.id.rgSex)
|
|
|
|
|
RadioGroup rgSex;
|
2019-04-02 17:41:53 +08:00
|
|
|
|
|
2019-04-10 22:19:06 +08:00
|
|
|
|
@Override
|
|
|
|
|
public int getLayoutRes() {
|
|
|
|
|
return R.layout.activity_main2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
protected void initViews() {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2019-04-02 17:41:53 +08:00
|
|
|
|
@Override
|
|
|
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
|
|
|
super.onCreate(savedInstanceState);
|
|
|
|
|
app =(MyApp) getApplicationContext();
|
|
|
|
|
// requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
|
2019-04-10 22:19:06 +08:00
|
|
|
|
|
|
|
|
|
// ButterKnife.bind(this);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
protected void setTitle() {
|
2019-04-11 18:05:41 +08:00
|
|
|
|
setTitle("");
|
2019-04-10 22:19:06 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
protected void initData() {
|
2019-04-02 17:41:53 +08:00
|
|
|
|
creatToolbar();
|
|
|
|
|
setupNavi();
|
|
|
|
|
showHome();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String currentActiveFragment;
|
|
|
|
|
private void showFragment(Fragment fragment, String fragmentTag)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
FragmentManager fm = getSupportFragmentManager();
|
|
|
|
|
FragmentTransaction ft = fm.beginTransaction();
|
|
|
|
|
|
|
|
|
|
if (findViewById(R.id.realtabcontent) != null) { //realtabcontent
|
|
|
|
|
|
|
|
|
|
ft.replace(R.id.realtabcontent, fragment,fragmentTag);
|
|
|
|
|
|
|
|
|
|
ft.addToBackStack(null); //add to backstack.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
try{
|
|
|
|
|
ft.add(R.id.realtabcontent, fragment,fragmentTag);
|
|
|
|
|
}catch(Exception e){
|
|
|
|
|
// Utils.logStackTrace(e, dTAG);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
currentActiveFragment =fragmentTag;
|
|
|
|
|
// ft.setTransition(2500);//TRANSIT_FRAGMENT_OPEN
|
|
|
|
|
ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
|
|
|
|
|
|
|
|
|
|
ft.commitAllowingStateLoss();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private ActionBarDrawerToggle toggle;
|
|
|
|
|
private void creatToolbar() {
|
|
|
|
|
|
|
|
|
|
// toolbar= (Toolbar) findViewById(R.id.toolbar);
|
2019-04-11 18:05:41 +08:00
|
|
|
|
|
2019-04-02 17:41:53 +08:00
|
|
|
|
setSupportActionBar(toolbar);
|
|
|
|
|
// toolbar.setNavigationIcon(R.mipmap.ic_launcher_round);//设置导航栏图标
|
|
|
|
|
// toolbar.setLogo(R.mipmap.ic_launcher);//设置app logo
|
|
|
|
|
// toolbar.setTitle("Title");//设置主标题
|
|
|
|
|
// setTitle("titleaa");
|
|
|
|
|
// toolbar.setSubtitle("Subtitle");//设置子标题
|
|
|
|
|
toolbar.inflateMenu(R.menu.main);//设置右上角的填充菜单
|
|
|
|
|
toolbar.setOnMenuItemClickListener(new Toolbar.OnMenuItemClickListener() {
|
|
|
|
|
@Override
|
|
|
|
|
public boolean onMenuItemClick(MenuItem item) {
|
|
|
|
|
int menuItemId = item.getItemId();
|
|
|
|
|
if (menuItemId == R.id.menuFenlei) {
|
|
|
|
|
|
|
|
|
|
Intent intent = new Intent(Main2Activity.this, activity_cates.class);
|
|
|
|
|
startActivity(intent);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}else if(menuItemId == R.id.menuMore) {
|
|
|
|
|
showShelfMoreSheet();
|
|
|
|
|
}
|
|
|
|
|
else if(menuItemId == R.id.menuFinshi) {
|
|
|
|
|
udateShelfZhengli();
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void udateShelfZhengli() {
|
|
|
|
|
switchShelfZhengli(true);
|
|
|
|
|
}
|
|
|
|
|
Fragment_Shelf fragment_shelf;
|
|
|
|
|
public void setShelfFragment(Fragment_Shelf fragment_shelf){
|
|
|
|
|
this.fragment_shelf=fragment_shelf;
|
|
|
|
|
}
|
|
|
|
|
private void showShelfMoreSheet() {
|
|
|
|
|
{
|
|
|
|
|
if(fragment_shelf!=null)
|
|
|
|
|
fragment_shelf.showShelfMoreSheet();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void setupNavi() {
|
|
|
|
|
|
|
|
|
|
//drawer
|
|
|
|
|
navigationView = (NavigationView) findViewById(R.id.nav_view);
|
|
|
|
|
navigationView.setNavigationItemSelectedListener(this);
|
|
|
|
|
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
|
|
|
|
|
toggle = new ActionBarDrawerToggle(
|
|
|
|
|
this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
|
|
|
|
|
drawer.addDrawerListener(toggle);
|
|
|
|
|
toggle.syncState();
|
|
|
|
|
|
|
|
|
|
// mTextMessage = (TextView) findViewById(R.id.message);
|
|
|
|
|
botoomNavigation = (BottomNavigationView) findViewById(R.id.navigation);
|
|
|
|
|
botoomNavigation.setOnNavigationItemSelectedListener(mOnNavigationItemSelectedListener);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void onBackPressed() {
|
|
|
|
|
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
|
|
|
|
|
if (drawer.isDrawerOpen(GravityCompat.START)) {
|
|
|
|
|
drawer.closeDrawer(GravityCompat.START);
|
|
|
|
|
} else {
|
|
|
|
|
super.onBackPressed();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@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);
|
|
|
|
|
SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE);
|
|
|
|
|
SearchView searchView = (SearchView) menu.findItem(R.id.menuSearch).getActionView();
|
|
|
|
|
// Assumes current activity is the searchable activity
|
|
|
|
|
searchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName()));
|
|
|
|
|
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();
|
|
|
|
|
|
|
|
|
|
//noinspection SimplifiableIfStatement
|
|
|
|
|
if (id == R.id.action_settings) {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return super.onOptionsItemSelected(item);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@SuppressWarnings("StatementWithEmptyBody")
|
|
|
|
|
@Override
|
|
|
|
|
public boolean onNavigationItemSelected(MenuItem item) {
|
|
|
|
|
// Handle navigation view item clicks here.
|
|
|
|
|
int id = item.getItemId();
|
|
|
|
|
|
|
|
|
|
if (id == R.id.nav_camera) {
|
|
|
|
|
// Handle the camera action
|
|
|
|
|
} else if (id == R.id.nav_gallery) {
|
|
|
|
|
|
|
|
|
|
} else if (id == R.id.nav_slideshow) {
|
|
|
|
|
|
|
|
|
|
} else if (id == R.id.nav_manage) {
|
|
|
|
|
|
|
|
|
|
} else if (id == R.id.nav_share) {
|
|
|
|
|
|
|
|
|
|
} else if (id == R.id.nav_send) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
|
|
|
|
|
drawer.closeDrawer(GravityCompat.START);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private BottomNavigationView.OnNavigationItemSelectedListener mOnNavigationItemSelectedListener
|
|
|
|
|
= new BottomNavigationView.OnNavigationItemSelectedListener() {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public boolean onNavigationItemSelected(@NonNull MenuItem item) {
|
|
|
|
|
switch (item.getItemId()) {
|
|
|
|
|
case R.id.navigation_home:
|
|
|
|
|
//mTextMessage.setText(R.string.title_home);
|
|
|
|
|
bottomSelectedIndex =0;
|
|
|
|
|
showHome();
|
|
|
|
|
return true;
|
|
|
|
|
case R.id.navigation_dashboard:
|
|
|
|
|
// mTextMessage.setText(R.string.title_dashboard);
|
|
|
|
|
bottomSelectedIndex=1;
|
|
|
|
|
showBookStore();
|
|
|
|
|
return true;
|
|
|
|
|
case R.id.navigation_notifications:
|
|
|
|
|
bottomSelectedIndex=2;
|
|
|
|
|
// mTextMessage.setText(R.string.title_notifications);
|
|
|
|
|
showPaihang();
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
@BindView(R.id.sexSelect)
|
|
|
|
|
AppCompatSpinner spinner;
|
|
|
|
|
@BindView(R.id.toolbarTitle)
|
|
|
|
|
TextView txtTitle;
|
|
|
|
|
private int bottomSelectedIndex;
|
|
|
|
|
|
|
|
|
|
public void swithToolbarItems( ) {
|
|
|
|
|
|
|
|
|
|
Log.e( TAG, "swithToolbarItems: " );
|
2019-04-11 18:20:10 +08:00
|
|
|
|
boolean showToggle =true;//bottomSelectedIndex !=1;
|
2019-04-02 17:41:53 +08:00
|
|
|
|
boolean showSpinner = bottomSelectedIndex ==1;
|
|
|
|
|
boolean showTitle = bottomSelectedIndex !=1;
|
|
|
|
|
String title = bottomSelectedIndex==0?"我的书架":"排行榜";
|
2019-04-11 18:20:10 +08:00
|
|
|
|
// txtTitle.setVisibility(View.GONE);
|
|
|
|
|
// toggle.setDrawerIndicatorEnabled(showToggle);
|
|
|
|
|
// toggle.syncState();
|
2019-04-02 17:41:53 +08:00
|
|
|
|
|
2019-04-14 23:17:31 +08:00
|
|
|
|
//spinner.setVisibility( showSpinner?View.VISIBLE:View.GONE);
|
|
|
|
|
rgSex.setVisibility( showSpinner?View.VISIBLE:View.GONE);
|
2019-04-02 17:41:53 +08:00
|
|
|
|
supportInvalidateOptionsMenu();
|
|
|
|
|
//invalidateOptionsMenu();
|
|
|
|
|
|
|
|
|
|
if(bottomSelectedIndex==1) {
|
|
|
|
|
title ="";
|
|
|
|
|
}
|
2019-04-11 18:05:41 +08:00
|
|
|
|
txtTitle.setText(title);
|
2019-04-11 18:20:10 +08:00
|
|
|
|
// this.setTitle(title);
|
2019-04-02 17:41:53 +08:00
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public boolean onPrepareOptionsMenu(Menu menu) {
|
|
|
|
|
Log.e(TAG, "onPrepareOptionsMenu");
|
|
|
|
|
|
|
|
|
|
menu.findItem(R.id.menuFinshi).setVisible(false);
|
|
|
|
|
// menu.findItem(R.id.menuSearch).setVisible(true);
|
|
|
|
|
if(bottomSelectedIndex==0) {
|
|
|
|
|
menu.findItem(R.id.menuFinshi).setVisible(isShelfZhengli);
|
|
|
|
|
if(isShelfZhengli){
|
|
|
|
|
menu.findItem(R.id.menuFenlei).setVisible(false);
|
|
|
|
|
menu.findItem(R.id.menuMore).setVisible(false);
|
|
|
|
|
menu.findItem(R.id.menuSearch).setVisible(false);
|
|
|
|
|
}else {
|
|
|
|
|
menu.findItem(R.id.menuFenlei).setVisible(false);
|
|
|
|
|
menu.findItem(R.id.menuMore).setVisible(true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}else if(bottomSelectedIndex==1) {
|
|
|
|
|
menu.findItem(R.id.menuFenlei).setVisible(true);
|
|
|
|
|
menu.findItem(R.id.menuMore).setVisible(false);
|
|
|
|
|
|
|
|
|
|
}else if(bottomSelectedIndex==2) {
|
|
|
|
|
menu.findItem(R.id.menuFenlei).setVisible(false);
|
|
|
|
|
menu.findItem(R.id.menuMore).setVisible(false);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return super.onPrepareOptionsMenu(menu);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void showHome() {
|
|
|
|
|
|
|
|
|
|
Fragment_Shelf fragment_Shelf = (Fragment_Shelf) getSupportFragmentManager()
|
|
|
|
|
.findFragmentByTag(Fragment_Shelf.getFTag());
|
|
|
|
|
if(fragment_Shelf==null) fragment_Shelf =new Fragment_Shelf();
|
|
|
|
|
showFragment(fragment_Shelf,Fragment_Shelf.getFTag());
|
|
|
|
|
swithToolbarItems();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
private void showBookStore() {
|
|
|
|
|
Fragment_bookStore fragment = (Fragment_bookStore) getSupportFragmentManager()
|
|
|
|
|
.findFragmentByTag(Fragment_bookStore.getFTag());
|
|
|
|
|
if(fragment ==null) fragment =new Fragment_bookStore();
|
|
|
|
|
showFragment(fragment , Fragment_bookStore.getFTag());
|
|
|
|
|
swithToolbarItems();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
private void showOther() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void showPaihang(){
|
|
|
|
|
|
|
|
|
|
Fragment_paihang fragment = (Fragment_paihang) getSupportFragmentManager()
|
|
|
|
|
.findFragmentByTag(Fragment_paihang.getFTag());
|
|
|
|
|
if(fragment ==null) fragment =new Fragment_paihang();
|
|
|
|
|
showFragment(fragment ,Fragment_paihang.getFTag());
|
|
|
|
|
swithToolbarItems( );
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
long firstTime =0;
|
|
|
|
|
@Override
|
|
|
|
|
public boolean onKeyUp(int keyCode, KeyEvent event) {
|
|
|
|
|
|
|
|
|
|
if (keyCode == KeyEvent.KEYCODE_BACK) {
|
|
|
|
|
if( navigationView.isShown()){
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
int cnt=0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
long secondTime = System.currentTimeMillis();
|
|
|
|
|
if (secondTime - firstTime > 800) {//如果两次按键时间间隔大于800毫秒,则不退出
|
|
|
|
|
String msg= "再按一次将退出" ;
|
|
|
|
|
Toast.makeText( this, msg, Toast.LENGTH_SHORT).show();
|
|
|
|
|
firstTime = secondTime;//更新firstTime
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
} else {
|
|
|
|
|
// return super.onKeyUp(keyCode, event);
|
|
|
|
|
|
|
|
|
|
// return super.onKeyUp(keyCode, event);
|
|
|
|
|
// return false;
|
|
|
|
|
finish();
|
|
|
|
|
app.exit();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
try{
|
|
|
|
|
return super.onKeyUp(keyCode, event);
|
|
|
|
|
}
|
|
|
|
|
catch(Exception e){
|
|
|
|
|
Log.d("mainActivity","onkeyup出错" );
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void onResume() {
|
|
|
|
|
super.onResume();
|
|
|
|
|
// swithToolbarItems( );
|
|
|
|
|
// setTitle("title on resume");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2019-04-14 23:17:31 +08:00
|
|
|
|
|
|
|
|
|
@OnClick({R.id.radioButtonBoy,R.id.radioButtonGirl})
|
|
|
|
|
void Onclick(View view){
|
|
|
|
|
int s;
|
|
|
|
|
switch (view.getId()) {
|
|
|
|
|
case R.id.radioButtonBoy:
|
|
|
|
|
s = rgSex.getCheckedRadioButtonId() == R.id.radioButtonBoy ?1:0;
|
|
|
|
|
if(s!= Constants.SEX){
|
|
|
|
|
Constants.SEX=s;
|
|
|
|
|
Fragment current = getSupportFragmentManager().findFragmentById(R.id.realtabcontent);
|
|
|
|
|
if (current != null && current instanceof BasicFragment){
|
|
|
|
|
((BasicFragment)current).reload();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case R.id.radioButtonGirl:
|
|
|
|
|
s = rgSex.getCheckedRadioButtonId() == R.id.radioButtonBoy ?1:0;
|
|
|
|
|
if(s!= Constants.SEX){
|
|
|
|
|
Constants.SEX=s;
|
|
|
|
|
Fragment current = getSupportFragmentManager().findFragmentById(R.id.realtabcontent);
|
|
|
|
|
if (current != null && current instanceof BasicFragment){
|
|
|
|
|
((BasicFragment)current).reload();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2019-04-02 17:41:53 +08:00
|
|
|
|
public void hideBottomNavi(){
|
|
|
|
|
botoomNavigation.setVisibility(View.GONE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
boolean isShelfZhengli =false;
|
|
|
|
|
public void switchShelfZhengli(boolean finished){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(finished) {
|
|
|
|
|
isShelfZhengli = false;
|
|
|
|
|
swithToolbarItems();
|
|
|
|
|
botoomNavigation.setVisibility(View.VISIBLE);
|
|
|
|
|
fragment_shelf.initReceyleView();
|
|
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
toggle.setDrawerIndicatorEnabled(false);
|
|
|
|
|
toggle.syncState();
|
|
|
|
|
supportInvalidateOptionsMenu();
|
|
|
|
|
isShelfZhengli = true;
|
|
|
|
|
botoomNavigation.setVisibility(View.GONE);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|