Skip to content

Commit

Permalink
优化若干
Browse files Browse the repository at this point in the history
  • Loading branch information
snpmyn committed Feb 3, 2021
1 parent e3d2ee8 commit 779dd8e
Show file tree
Hide file tree
Showing 12 changed files with 29 additions and 28 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
|:-:|:-:|
| 示例app | implementation project(path: ':fragmentation') |
| 示例app | implementation project(path: ':eventbusactivityscope') |
| 一方库FragmentationCore | api 'com.github.snpmyn.Util:*utilone*:v0.0.1.2X'(避重)|
| 一方库FragmentationCore | api 'com.github.snpmyn.Util:*utilone*:v0.0.1.3X'(避重)|
| 一方库Fragmentation | api project(path: ':fragmentationcore') |
| 一方库EventbusActivityScope | implementation 'com.github.snpmyn.Util:*utilone*:v0.0.1.2X' |
| 一方库EventbusActivityScope | implementation 'com.github.snpmyn.Util:*utilone*:v0.0.1.3X' |
| 一方库EventbusActivityScope | implementation 'org.greenrobot:eventbus:3.1.1' |
| 二方库Util-示例app | implementation project(path: ':utilone') |
| 二方库Util-示例app | implementation project(path: ':utiltwo') |
Expand Down Expand Up @@ -69,7 +69,7 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.1'
classpath 'com.android.tools.build:gradle:4.1.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down Expand Up @@ -107,8 +107,8 @@ android {
}
dependencies {
implementation 'com.github.snpmyn.SmartFragment:fragmentation:v0.0.1.2X'
implementation 'com.github.snpmyn.SmartFragment:eventbusactivityscope:v0.0.1.2X'
implementation 'com.github.snpmyn.SmartFragment:fragmentation:v0.0.1.3X'
implementation 'com.github.snpmyn.SmartFragment:eventbusactivityscope:v0.0.1.3X'
}
```

Expand Down
12 changes: 6 additions & 6 deletions app/src/main/java/fragmentation/base/BaseBackFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

import com.google.android.material.appbar.MaterialToolbar;
import com.zsp.fragmentation.SupportFragment;
import com.zsp.smartfragment.R;

import butterknife.ButterKnife;
import butterknife.Unbinder;
Expand Down Expand Up @@ -140,13 +139,14 @@ public void onDetach() {
abstract int layoutResId();

/**
* 初始ToolbarNavigation
* 初始 MaterialToolbarNavigation
*
* @param materialToolbar MaterialToolbar
* @param materialToolbar materialToolbar
* @param resId 资源 ID
*/
protected void stepToolbarNavigation(MaterialToolbar materialToolbar) {
materialToolbar.setNavigationIcon(R.drawable.back);
materialToolbar.setNavigationOnClickListener(v -> fragmentationSupportActivity.onBackPressed());
protected void stepMaterialToolbarNavigation(MaterialToolbar materialToolbar, int resId) {
materialToolbar.setNavigationIcon(resId);
materialToolbar.setNavigationOnClickListener(view -> fragmentationSupportActivity.onBackPressed());
}

/**
Expand Down
9 changes: 5 additions & 4 deletions app/src/main/java/fragmentation/base/BaseFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -188,12 +188,13 @@ public void onDetach() {
protected abstract int layoutResId();

/**
* 初始ToolbarNavigation
* 初始 MaterialToolbarNavigation
*
* @param materialToolbar toolbar
* @param materialToolbar materialToolbar
* @param resId 资源 ID
*/
protected void stepToolbarNavigation(MaterialToolbar materialToolbar) {
materialToolbar.setNavigationIcon(R.drawable.back);
protected void stepMaterialToolbarNavigation(MaterialToolbar materialToolbar, int resId) {
materialToolbar.setNavigationIcon(resId);
materialToolbar.setNavigationOnClickListener(view -> fragmentationSupportActivity.onBackPressed());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ protected void eventBusRegister() {
@Override
protected void stepUi(View view) {
MaterialToolbar materialToolbar = view.findViewById(R.id.zhiHuFragmentFourthMt);
stepToolbarNavigation(materialToolbar);
stepMaterialToolbarNavigation(materialToolbar, R.drawable.back);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ protected void eventBusRegister() {
@Override
protected void stepUi(View view) {
materialToolbar.setTitle(mTitle);
stepToolbarNavigation(materialToolbar);
stepMaterialToolbarNavigation(materialToolbar, R.drawable.back);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ protected void eventBusRegister() {
@Override
protected void stepUi(View view) {
toolbarMt.setTitle(getString(R.string.testStartForResult));
stepToolbarNavigation(toolbarMt);
stepMaterialToolbarNavigation(toolbarMt, R.drawable.back);
zhiHuModifyDetailEtInput.setText(mTitle);
}

Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ buildscript {

}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.1'
classpath 'com.android.tools.build:gradle:4.1.2'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
2 changes: 1 addition & 1 deletion eventbusactivityscope/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ dependencies {

implementation 'androidx.appcompat:appcompat:1.2.0'
/*自带*/
implementation 'com.github.snpmyn.Util:utilone:v0.0.1.2X'
implementation 'com.github.snpmyn.Util:utilone:v0.0.1.3X'
/*util*/
implementation 'org.greenrobot:eventbus:3.1.1'
/*eventbus*/
Expand Down
2 changes: 1 addition & 1 deletion fragmentationcore/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ dependencies {

implementation 'androidx.appcompat:appcompat:1.2.0'
/*自带*/
api 'com.github.snpmyn.Util:utilone:v0.0.1.2X'
api 'com.github.snpmyn.Util:utilone:v0.0.1.3X'
/*util*/
}
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ void showFragmentStackHierarchyView() {
* <p>
* 调试用。
*/
void logFragmentStackHierarchy(String tag) {
mDebugStackDelegate.logFragmentRecords(tag);
void logFragmentStackHierarchy() {
mDebugStackDelegate.logFragmentRecords();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ static void hideSoftInput(View view) {

/**
* 显栈视图对话框
* <p>
* 调试用。
*/
public static void showFragmentStackHierarchyView(ISupportActivity support) {
Expand All @@ -71,10 +72,11 @@ public static void showFragmentStackHierarchyView(ISupportActivity support) {

/**
* 显栈视图日志
* <p>
* 调试用。
*/
public static void logFragmentStackHierarchy(ISupportActivity support, String tag) {
support.getSupportDelegate().logFragmentStackHierarchy(tag);
public static void logFragmentStackHierarchy(ISupportActivity support) {
support.getSupportDelegate().logFragmentStackHierarchy();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,8 @@ public void showFragmentStackHierarchyView() {
* 调试相关
* <p>
* Log形式打印栈视图。
*
* @param tag tag
*/
public void logFragmentRecords(String tag) {
public void logFragmentRecords() {
List<DebugFragmentRecord> fragmentRecordList = getFragmentRecords();
if (fragmentRecordList == null) {
return;
Expand Down

0 comments on commit 779dd8e

Please sign in to comment.