Skip to content

Commit

Permalink
update version of support library and gradle plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
cgspine committed Nov 15, 2017
1 parent 80c9f87 commit dd714ab
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 44 deletions.
12 changes: 7 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
Expand All @@ -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"
}
}
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -80,19 +80,20 @@ protected void showKeyBoard() {
* 隐藏键盘
*/
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 {
Expand All @@ -105,17 +106,6 @@ public void onCreate(Bundle savedInstanceState) {
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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,28 +42,6 @@ public void onBackPressed() {
}
}

@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。
*/
Expand Down

0 comments on commit dd714ab

Please sign in to comment.