Skip to content

Commit

Permalink
优化
Browse files Browse the repository at this point in the history
  • Loading branch information
Invinciblelee committed Jun 27, 2019
1 parent 8856132 commit 4d8b076
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public void onWindowFocusChanged(boolean hasFocus) {
@Override
public boolean onCreateOptionsMenu(Menu menu) {
if (menu != null) {
if(menu instanceof MenuBuilder) {
if (menu instanceof MenuBuilder) {
((MenuBuilder) menu).setOptionalIconsVisible(true);
}
for (int i = 0; i < menu.size(); i++) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import com.google.android.material.internal.NavigationMenuView;
import com.google.android.material.navigation.NavigationView;
import com.monke.monkeybook.R;
import com.monke.monkeybook.utils.DensityUtil;
import com.monke.monkeybook.utils.ScreenUtils;

import java.lang.reflect.Field;
Expand Down Expand Up @@ -53,7 +54,7 @@ public static void useCustomIconForSearchView(SearchView searchView, String hint
searchIcon.setBounds(0, 0, textSize, textSize);
setTint(searchIcon, normalColor);
searchText.setCompoundDrawablesRelative(searchIcon, null, null, null);
searchText.setCompoundDrawablePadding(ScreenUtils.dpToPx(5));
searchText.setCompoundDrawablePadding(DensityUtil.dp2px(searchText.getContext(), 5));
searchText.setIncludeFontPadding(false);

AppCompatImageView close = searchView.findViewById(R.id.search_close_btn);
Expand All @@ -62,11 +63,12 @@ public static void useCustomIconForSearchView(SearchView searchView, String hint

LinearLayout plate = searchView.findViewById(R.id.search_plate);
LinearLayout.LayoutParams params = (LinearLayout.LayoutParams) plate.getLayoutParams();
params.topMargin = ScreenUtils.dpToPx(5);
params.bottomMargin = ScreenUtils.dpToPx(5);
params.topMargin = DensityUtil.dp2px(plate.getContext(), 5);
params.bottomMargin = params.topMargin;
plate.setLayoutParams(params);

plate.setPaddingRelative(ScreenUtils.dpToPx(6), 0, ScreenUtils.dpToPx(6), 0);
int padding = DensityUtil.dp2px(plate.getContext(), 6);
plate.setPaddingRelative(padding, 0, padding, 0);

if (showBg) {
Drawable bag = searchView.getResources().getDrawable(R.drawable.bg_search_field);
Expand Down
4 changes: 2 additions & 2 deletions app/version.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#Fri Jun 21 15:54:21 CST 2019
VERSION_CODE=3132
#Thu Jun 27 16:20:14 CST 2019
VERSION_CODE=3134
3 changes: 0 additions & 3 deletions basemvplib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ android {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
android {
}
}

compileOptions {
Expand All @@ -33,7 +31,6 @@ dependencies {
api 'io.reactivex.rxjava2:rxandroid:2.1.1'
api 'io.reactivex.rxjava2:rxjava:2.2.10'
//Retrofit
api 'com.squareup.okhttp3:logging-interceptor:4.0.0'
api 'com.squareup.retrofit2:retrofit:2.6.0'
api 'com.squareup.retrofit2:adapter-rxjava2:2.6.0'
api 'com.squareup.retrofit2:converter-scalars:2.6.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ private Interceptor getHeaderInterceptor() {
};
}

//请求头拦截器
public class RequestHeadersInterceptor implements Interceptor {

@Override
Expand All @@ -126,6 +127,7 @@ public Response intercept(Chain chain) throws IOException {
}
}

//响应头拦截器
public class CacheControlInterceptor implements Interceptor {

@Override
Expand Down

0 comments on commit 4d8b076

Please sign in to comment.