working on title
This commit is contained in:
parent
56427a7621
commit
b816fcd07a
|
@ -279,13 +279,13 @@ private int bottomSelectedIndex;
|
||||||
public void swithToolbarItems( ) {
|
public void swithToolbarItems( ) {
|
||||||
|
|
||||||
Log.e( TAG, "swithToolbarItems: " );
|
Log.e( TAG, "swithToolbarItems: " );
|
||||||
boolean showToggle =bottomSelectedIndex !=1;
|
boolean showToggle =true;//bottomSelectedIndex !=1;
|
||||||
boolean showSpinner = bottomSelectedIndex ==1;
|
boolean showSpinner = bottomSelectedIndex ==1;
|
||||||
boolean showTitle = bottomSelectedIndex !=1;
|
boolean showTitle = bottomSelectedIndex !=1;
|
||||||
String title = bottomSelectedIndex==0?"我的书架":"排行榜";
|
String title = bottomSelectedIndex==0?"我的书架":"排行榜";
|
||||||
|
// txtTitle.setVisibility(View.GONE);
|
||||||
toggle.setDrawerIndicatorEnabled(showToggle);
|
// toggle.setDrawerIndicatorEnabled(showToggle);
|
||||||
toggle.syncState();
|
// toggle.syncState();
|
||||||
|
|
||||||
spinner.setVisibility( showSpinner?View.VISIBLE:View.GONE);
|
spinner.setVisibility( showSpinner?View.VISIBLE:View.GONE);
|
||||||
|
|
||||||
|
@ -296,7 +296,7 @@ private int bottomSelectedIndex;
|
||||||
title ="";
|
title ="";
|
||||||
}
|
}
|
||||||
txtTitle.setText(title);
|
txtTitle.setText(title);
|
||||||
this.setTitle(title);
|
// this.setTitle(title);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -244,7 +244,7 @@ public class HttpMethods {
|
||||||
public Response intercept(Chain chain) throws IOException {
|
public Response intercept(Chain chain) throws IOException {
|
||||||
Response originalResponse = chain.proceed(chain.request());
|
Response originalResponse = chain.proceed(chain.request());
|
||||||
String cacheControl = originalResponse.header("Cache-Control");
|
String cacheControl = originalResponse.header("Cache-Control");
|
||||||
int maxAge =0; //一小时
|
int maxAge =60*60; //一小时
|
||||||
if (cacheControl == null || cacheControl.contains("no-store") || cacheControl.contains("no-cache") ||
|
if (cacheControl == null || cacheControl.contains("no-store") || cacheControl.contains("no-cache") ||
|
||||||
cacheControl.contains("must-revalidate") || cacheControl.contains("max-age=0")) { //目标网站禁用cache则设置为1小时
|
cacheControl.contains("must-revalidate") || cacheControl.contains("max-age=0")) { //目标网站禁用cache则设置为1小时
|
||||||
return originalResponse.newBuilder()
|
return originalResponse.newBuilder()
|
||||||
|
@ -252,11 +252,7 @@ public class HttpMethods {
|
||||||
.header("Cache-Control", "public, max-age=" + maxAge)
|
.header("Cache-Control", "public, max-age=" + maxAge)
|
||||||
.build();
|
.build();
|
||||||
} else {
|
} else {
|
||||||
return originalResponse.newBuilder()
|
return originalResponse;
|
||||||
.removeHeader("Pragma")
|
|
||||||
.header("Cache-Control", "public, max-age=" + maxAge)
|
|
||||||
.build();
|
|
||||||
// return originalResponse;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:visibility="visible"
|
android:visibility="visible"
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
android:background="@color/colorAccent"
|
|
||||||
/>
|
/>
|
||||||
<android.support.v7.widget.AppCompatSpinner
|
<android.support.v7.widget.AppCompatSpinner
|
||||||
android:id="@+id/sexSelect"
|
android:id="@+id/sexSelect"
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="80dp"
|
android:layout_height="80dp"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
|
android:visibility="gone"
|
||||||
android:gravity="center">
|
android:gravity="center">
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/llTuijian2"
|
android:id="@+id/llTuijian2"
|
||||||
|
|
Loading…
Reference in New Issue