update version of support library and gradle plugin

This commit is contained in:
cgspine
2017-11-14 21:06:30 +08:00
parent 80c9f8791b
commit dd714ab40b
4 changed files with 14 additions and 44 deletions
+7 -5
View File
@@ -2,11 +2,12 @@
buildscript {
repositories {
google()
jcenter()
mavenLocal()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.android.tools.build:gradle:3.0.0'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.2'
}
@@ -16,13 +17,14 @@ allprojects {
repositories {
jcenter()
mavenLocal()
google()
}
ext {
buildToolsVersion = "24.0.3"
buildToolsVersion = "26.0.2"
minSdkVersion = 14
targetSdkVersion = 25
compileSdkVersion = 25
supportVersion = "25.3.1"
targetSdkVersion = 26
compileSdkVersion = 26
supportVersion = "27.0.1"
}
}
+2 -2
View File
@@ -1,6 +1,6 @@
#Mon Dec 28 10:00:20 PST 2015
#Tue Nov 14 17:54:35 CST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
@@ -80,19 +80,20 @@ public abstract class BaseFragment extends Fragment {
* 隐藏键盘
*/
protected boolean hideKeyBoard() {
// return mBaseActivityImpl.hideKeyBoard();
final InputMethodManager imm = (InputMethodManager) getActivity().getApplicationContext()
.getSystemService(Context.INPUT_METHOD_SERVICE);
return imm.hideSoftInputFromWindow(getActivity().findViewById(android.R.id.content)
.getWindowToken(), 0);
}
//============================= 生命周期 ================================
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = onCreateView();
if (translucentFull()) {
if (mBaseView instanceof QMUIWindowInsetLayout) {
if (view instanceof QMUIWindowInsetLayout) {
view.setFitsSystemWindows(false);
mBaseView = view;
} else {
@@ -105,17 +106,6 @@ public abstract class BaseFragment extends Fragment {
mBaseView = view;
}
QMUIViewHelper.requestApplyInsets(getActivity().getWindow());
}
//============================= 生命周期 ================================
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
if (mBaseView.getParent() != null) {
((ViewGroup) mBaseView.getParent()).removeView(mBaseView);
}
getBaseFragmentActivity().clearDisappearInfo(mBaseView);
return mBaseView;
}
@@ -42,28 +42,6 @@ public abstract class BaseFragmentActivity extends AppCompatActivity {
}
}
@SuppressWarnings("TryWithIdenticalCatches")
public void clearDisappearInfo(View view) {
if (view != null) {
try {
Field field = ViewGroup.class.getDeclaredField("mDisappearingChildren");
field.setAccessible(true);
Object o = field.get(mFragmentContainer);
if(o != null && o instanceof ArrayList){
ArrayList disappearingChildren = (ArrayList) o;
if (disappearingChildren.contains(view)) {
Log.i(TAG, "ViewGroup.mDisappearingChildren contain the targetView");
disappearingChildren.remove(view);
}
}
} catch (NoSuchFieldException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
}
}
}
/**
* 获取当前的 Fragment。
*/