├── .gitignore
├── .idea
├── codeStyles
│ └── Project.xml
├── gradle.xml
├── misc.xml
└── runConfigurations.xml
├── README.md
├── app
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── behavior
│ │ └── bottombehaviormaster
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ └── com
│ │ │ └── behavior
│ │ │ └── bottombehaviormaster
│ │ │ ├── MyApplication.java
│ │ │ ├── activity
│ │ │ ├── MainActivity.java
│ │ │ └── TestActivity.java
│ │ │ ├── dialog
│ │ │ ├── BaseBottomSheetDialog.java
│ │ │ └── BottomSheetDialog.java
│ │ │ └── view
│ │ │ └── CustomerVideoView.java
│ └── res
│ │ ├── drawable-v24
│ │ └── ic_launcher_foreground.xml
│ │ ├── drawable
│ │ └── ic_launcher_background.xml
│ │ ├── layout
│ │ ├── activity_main.xml
│ │ ├── activity_test.xml
│ │ ├── view_comment_item.xml
│ │ └── view_dialog_comment.xml
│ │ ├── mipmap-anydpi-v26
│ │ ├── ic_launcher.xml
│ │ └── ic_launcher_round.xml
│ │ ├── mipmap-hdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-mdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxxhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ └── values
│ │ ├── colors.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ └── test
│ └── java
│ └── com
│ └── behavior
│ └── bottombehaviormaster
│ └── ExampleUnitTest.java
├── build.gradle
├── gif
└── 21134244-7e7a289febb2f094.gif
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── mybehavior
├── .gitignore
├── build.gradle
├── consumer-rules.pro
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── behavior
│ │ └── mybehavior
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ └── res
│ │ ├── drawable
│ │ ├── icon_comment_close.png
│ │ ├── icon_comment_zan.png
│ │ └── shape_dialog_send_comment_btn.xml
│ │ ├── raw
│ │ └── test.mp4
│ │ └── values
│ │ ├── colors.xml
│ │ ├── dimens.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ └── test
│ └── java
│ └── com
│ └── behavior
│ └── mybehavior
│ └── ExampleUnitTest.java
└── settings.gradle
/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/caches
5 | /.idea/libraries
6 | /.idea/modules.xml
7 | /.idea/workspace.xml
8 | /.idea/navEditor.xml
9 | /.idea/assetWizardSettings.xml
10 | .DS_Store
11 | /build
12 | /captures
13 | .externalNativeBuild
14 | .cxx
15 |
--------------------------------------------------------------------------------
/.idea/codeStyles/Project.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | xmlns:android
11 |
12 | ^$
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 | xmlns:.*
22 |
23 | ^$
24 |
25 |
26 | BY_NAME
27 |
28 |
29 |
30 |
31 |
32 |
33 | .*:id
34 |
35 | http://schemas.android.com/apk/res/android
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 | .*:name
45 |
46 | http://schemas.android.com/apk/res/android
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 | name
56 |
57 | ^$
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 | style
67 |
68 | ^$
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 | .*
78 |
79 | ^$
80 |
81 |
82 | BY_NAME
83 |
84 |
85 |
86 |
87 |
88 |
89 | .*
90 |
91 | http://schemas.android.com/apk/res/android
92 |
93 |
94 | ANDROID_ATTRIBUTE_ORDER
95 |
96 |
97 |
98 |
99 |
100 |
101 | .*
102 |
103 | .*
104 |
105 |
106 | BY_NAME
107 |
108 |
109 |
110 |
111 |
112 |
113 |
--------------------------------------------------------------------------------
/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
19 |
20 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # behavior
2 |
3 | ### gif
4 |
5 |
6 |
7 | 简书:https://www.jianshu.com/p/5986aec86f87
8 |
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 28
5 | defaultConfig {
6 | applicationId "com.behavior.bottombehaviormaster"
7 | minSdkVersion 21
8 | targetSdkVersion 28
9 | versionCode 1
10 | versionName "1.0"
11 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
12 | }
13 | buildTypes {
14 | release {
15 | minifyEnabled false
16 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
17 | }
18 | }
19 | compileOptions {
20 | sourceCompatibility = 1.8
21 | targetCompatibility = 1.8
22 | }
23 | }
24 |
25 | dependencies {
26 | implementation fileTree(dir: 'libs', include: ['*.jar'])
27 | implementation project(':mybehavior')
28 | }
29 |
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/app/src/androidTest/java/com/behavior/bottombehaviormaster/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.behavior.bottombehaviormaster;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumented test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
23 |
24 | assertEquals("com.behavior.bottombehaviormaster", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/app/src/main/java/com/behavior/bottombehaviormaster/MyApplication.java:
--------------------------------------------------------------------------------
1 | package com.behavior.bottombehaviormaster;
2 |
3 | import android.app.Application;
4 |
5 | import com.blankj.utilcode.util.Utils;
6 |
7 | /**
8 | * @author Lix
9 | * @date 2020-02-01 21:30
10 | */
11 | public class MyApplication extends Application {
12 | @Override
13 | public void onCreate() {
14 | super.onCreate();
15 | //工具类初始化
16 | Utils.init(this);
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/app/src/main/java/com/behavior/bottombehaviormaster/activity/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.behavior.bottombehaviormaster.activity;
2 |
3 | import android.content.Intent;
4 | import android.os.Bundle;
5 | import android.support.v7.app.AppCompatActivity;
6 | import android.view.View;
7 |
8 | import com.behavior.bottombehaviormaster.R;
9 |
10 | public class MainActivity extends AppCompatActivity {
11 |
12 | @Override
13 | protected void onCreate(Bundle savedInstanceState) {
14 | super.onCreate(savedInstanceState);
15 | setContentView(R.layout.activity_main);
16 | findViewById(R.id.btn1).setOnClickListener(new View.OnClickListener() {
17 | @Override
18 | public void onClick(View view) {
19 | startActivity( new Intent(MainActivity.this,TestActivity.class));
20 | }
21 | });
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/app/src/main/java/com/behavior/bottombehaviormaster/activity/TestActivity.java:
--------------------------------------------------------------------------------
1 | package com.behavior.bottombehaviormaster.activity;
2 |
3 | import android.net.Uri;
4 | import android.os.Bundle;
5 | import android.support.annotation.NonNull;
6 | import android.support.design.widget.BottomSheetBehavior;
7 | import android.support.v7.app.AppCompatActivity;
8 | import android.support.v7.widget.LinearLayoutManager;
9 | import android.support.v7.widget.RecyclerView;
10 | import android.view.View;
11 | import android.view.ViewGroup;
12 | import android.widget.RelativeLayout;
13 | import android.widget.TextView;
14 | import android.widget.VideoView;
15 |
16 | import com.behavior.bottombehaviormaster.R;
17 | import com.behavior.bottombehaviormaster.dialog.BaseBottomSheetDialog;
18 | import com.behavior.bottombehaviormaster.dialog.BottomSheetDialog;
19 | import com.blankj.utilcode.util.BarUtils;
20 | import com.blankj.utilcode.util.LogUtils;
21 | import com.blankj.utilcode.util.ScreenUtils;
22 | import com.chad.library.adapter.base.BaseQuickAdapter;
23 | import com.chad.library.adapter.base.BaseViewHolder;
24 |
25 | import java.util.ArrayList;
26 | import java.util.List;
27 |
28 | public class TestActivity extends AppCompatActivity {
29 | VideoView videoView;
30 |
31 | @Override
32 | protected void onCreate(Bundle savedInstanceState) {
33 | super.onCreate(savedInstanceState);
34 | BarUtils.setStatusBarVisibility(this, false);
35 | setContentView(R.layout.activity_test);
36 | videoView = findViewById(R.id.videoView);
37 | String uri = "android.resource://" + getPackageName() + "/" + R.raw.test;
38 | videoView.setVideoURI(Uri.parse(uri));
39 | videoView.start();
40 | findViewById(R.id.floatBtn).setOnClickListener(new View.OnClickListener() {
41 | @Override
42 | public void onClick(View view) {
43 | final View[] views = new View[1];
44 | BottomSheetDialog mBottomCommentSheetDialog = new BottomSheetDialog();
45 | mBottomCommentSheetDialog.setFragmentManager(getSupportFragmentManager())
46 | .setLayoutRes(R.layout.view_dialog_comment)
47 | .setCancelOutside(true)
48 | .setViewListener(v1 -> {
49 | views[0] = findCommentView(v1);
50 | })
51 | .show();
52 | mBottomCommentSheetDialog.setBehaviorChanged(new BaseBottomSheetDialog.IBehaviorChanged() {
53 | @Override
54 | public void changedState(View bottomSheet, int state) {
55 | float width = ScreenUtils.getScreenWidth();
56 | float height = ScreenUtils.getScreenHeight();
57 | if (state == BottomSheetBehavior.STATE_EXPANDED) {
58 | float x = width / 2f;
59 | views[0].post(() -> {
60 | float scale = height - (views[0].getHeight());
61 | videoView.setScaleX(scale / height);
62 | videoView.setScaleY(scale / height);
63 | videoView.setPivotX(x);
64 | videoView.setPivotY(0);
65 | });
66 | } else if (state == BottomSheetBehavior.STATE_COLLAPSED) {
67 | videoView.setScaleX(1.0f);
68 | videoView.setScaleY(1.0f);
69 | videoView.setPivotX(0);
70 | videoView.setPivotY(0);
71 | }
72 | }
73 |
74 | @Override
75 | public void changedOffset(View bottomSheet, float slideOffset) {
76 | startAnimator(bottomSheet);
77 | }
78 | });
79 | }
80 | });
81 | }
82 |
83 | /**
84 | * @param parent
85 | */
86 | private void startAnimator(View parent) {
87 | float width = ScreenUtils.getScreenWidth();
88 | float height = ScreenUtils.getScreenHeight();
89 | float x = width / 2f;
90 | float py = parent.getY() / height;
91 | LogUtils.e(parent.getY());
92 | LogUtils.e(parent.getY() + BarUtils.getStatusBarHeight());
93 | videoView.setScaleX(py);
94 | videoView.setScaleY(py);
95 | videoView.setPivotX(x);
96 | videoView.setPivotY(0);
97 | }
98 |
99 | /**
100 | * 评论
101 | * 绑定View
102 | *
103 | * @param contentView
104 | */
105 | private View findCommentView(View contentView) {
106 | List list = new ArrayList<>();
107 | for (int i = 0; i < 10; i++) {
108 | list.add("i" + i);
109 | }
110 | RelativeLayout mCommentParent = contentView.findViewById(R.id.dialog_comments_layout);
111 | mCommentParent.setLayoutParams(new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, (int) (ScreenUtils.getScreenHeight() / 1.5)));
112 | RecyclerView mCommentRecycle = contentView.findViewById(R.id.dialog_comment_recycle);
113 | RelativeLayout mCloseCommentBtn = contentView.findViewById(R.id.dialog_close_comment);
114 | TextView mCommentNum = contentView.findViewById(R.id.dialog_comments_num);
115 | RelativeLayout mSendCommentLayout = contentView.findViewById(R.id.dialog_send_comment);
116 | RelativeLayout mCommentNull = contentView.findViewById(R.id.dialog_comment_null);
117 | mCommentNum.setText(list.size() + "条评论");
118 | mCommentRecycle.setLayoutManager(new LinearLayoutManager(this));
119 | mCommentRecycle.setAdapter(new BaseQuickAdapter(R.layout.view_comment_item, list) {
120 | @Override
121 | protected void convert(BaseViewHolder helper, Object item) {
122 |
123 | }
124 |
125 | @Override
126 | public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
127 |
128 | }
129 | });
130 |
131 | mCloseCommentBtn.setOnClickListener(v -> {
132 | });
133 |
134 | mSendCommentLayout.setOnClickListener(v -> {
135 |
136 | });
137 | return mCommentParent;
138 | }
139 |
140 | }
141 |
--------------------------------------------------------------------------------
/app/src/main/java/com/behavior/bottombehaviormaster/dialog/BaseBottomSheetDialog.java:
--------------------------------------------------------------------------------
1 | package com.behavior.bottombehaviormaster.dialog;
2 |
3 | import android.content.DialogInterface;
4 | import android.os.Bundle;
5 | import android.support.annotation.LayoutRes;
6 | import android.support.annotation.NonNull;
7 | import android.support.design.widget.BottomSheetBehavior;
8 | import android.support.design.widget.BottomSheetDialog;
9 | import android.support.design.widget.BottomSheetDialogFragment;
10 | import android.support.v4.app.FragmentManager;
11 | import android.view.LayoutInflater;
12 | import android.view.View;
13 | import android.view.ViewGroup;
14 | import android.view.WindowManager;
15 | import android.widget.FrameLayout;
16 |
17 | import com.behavior.bottombehaviormaster.R;
18 | import com.blankj.utilcode.util.BarUtils;
19 |
20 |
21 | public abstract class BaseBottomSheetDialog extends BottomSheetDialogFragment {
22 | private static final String TAG = "base_bottom_sheet_dialog";
23 |
24 | private IBehaviorChanged mBehaviorChanged;
25 |
26 |
27 | @LayoutRes
28 | public abstract int getLayoutRes();
29 |
30 | public abstract void bindView(View v);
31 |
32 | @Override
33 | public void onStart() {
34 | super.onStart();
35 | // 设置软键盘不自动弹出
36 | //设置 dialog 的宽高
37 | getDialog().getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, getDialog().getWindow().getAttributes().height);
38 | //设置 dialog 的背景为 null
39 | getDialog().getWindow().setBackgroundDrawableResource(R.color.colorTransparent);
40 | getDialog().getWindow().setDimAmount(0f);
41 | getDialog().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE | WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);
42 | getDialog().setOnDismissListener(new DialogInterface.OnDismissListener() {
43 | @Override
44 | public void onDismiss(DialogInterface dialogInterface) {
45 | if (mBehaviorChanged != null)
46 | mBehaviorChanged.changedState(null, BottomSheetBehavior.STATE_COLLAPSED);
47 | }
48 | });
49 | BarUtils.setStatusBarVisibility(getDialog().getWindow(), false);
50 | BottomSheetDialog dialog = (BottomSheetDialog) getDialog();
51 | FrameLayout bottomSheet = dialog.getDelegate().findViewById(android.support.design.R.id.design_bottom_sheet);
52 | if (bottomSheet != null) {
53 | BottomSheetBehavior behavior = BottomSheetBehavior.from(bottomSheet);
54 | // 初始为展开状态
55 | behavior.setState(BottomSheetBehavior.STATE_EXPANDED);
56 | behavior.setPeekHeight(0);
57 | if (mBehaviorChanged != null)
58 | mBehaviorChanged.changedState(null, BottomSheetBehavior.STATE_EXPANDED);
59 | behavior.setBottomSheetCallback(new BottomSheetBehavior.BottomSheetCallback() {
60 | @Override
61 | public void onStateChanged(@NonNull View bottomSheet, int newState) {
62 | if (newState == BottomSheetBehavior.STATE_HIDDEN || newState == BottomSheetBehavior.STATE_COLLAPSED) {
63 | dismiss();
64 | }
65 | if (mBehaviorChanged != null)
66 | mBehaviorChanged.changedState(bottomSheet, newState);
67 | }
68 |
69 | @Override
70 | public void onSlide(@NonNull View bottomSheet, float slideOffset) {
71 | if (mBehaviorChanged != null)
72 | mBehaviorChanged.changedOffset(bottomSheet, slideOffset);
73 | }
74 | });
75 | }
76 | }
77 |
78 | @Override
79 | public View onCreateView(LayoutInflater inflater, ViewGroup container,
80 | Bundle savedInstanceState) {
81 | getDialog().setCanceledOnTouchOutside(getCancelOutside());
82 | View v = inflater.inflate(getLayoutRes(), container, false);
83 | bindView(v);
84 | return v;
85 | }
86 |
87 | public IBehaviorChanged getBehaviorChanged() {
88 | return mBehaviorChanged;
89 | }
90 |
91 | public void setBehaviorChanged(IBehaviorChanged behaviorChanged) {
92 | mBehaviorChanged = behaviorChanged;
93 | }
94 |
95 | public interface IBehaviorChanged {
96 | void changedState(View bottomSheet, int state);
97 |
98 | void changedOffset(View bottomSheet, float slideOffset);
99 | }
100 |
101 | public boolean getCancelOutside() {
102 | return true;
103 | }
104 |
105 | public String getFragmentTag() {
106 | return TAG;
107 | }
108 |
109 | public void show(FragmentManager fragmentManager) {
110 | show(fragmentManager, getFragmentTag());
111 | }
112 |
113 | }
114 |
--------------------------------------------------------------------------------
/app/src/main/java/com/behavior/bottombehaviormaster/dialog/BottomSheetDialog.java:
--------------------------------------------------------------------------------
1 | package com.behavior.bottombehaviormaster.dialog;
2 |
3 | import android.os.Bundle;
4 | import android.support.annotation.LayoutRes;
5 | import android.support.v4.app.FragmentManager;
6 | import android.view.View;
7 |
8 | public class BottomSheetDialog extends BaseBottomSheetDialog {
9 |
10 | private static final String KEY_LAYOUT_RES = "bottom_layout_res";
11 | private static final String KEY_CANCEL_OUTSIDE = "bottom_cancel_outside";
12 |
13 | private FragmentManager mFragmentManager;
14 |
15 | private boolean mIsCancelOutside = super.getCancelOutside();
16 |
17 | private String mTag = super.getFragmentTag();
18 |
19 |
20 | @LayoutRes
21 | private int mLayoutRes;
22 |
23 | private ViewListener mViewListener;
24 |
25 | public static BottomSheetDialog create(FragmentManager manager) {
26 | BottomSheetDialog dialog = new BottomSheetDialog();
27 | dialog.setFragmentManager(manager);
28 | return dialog;
29 | }
30 |
31 | @Override
32 | public void onCreate(Bundle savedInstanceState) {
33 | super.onCreate(savedInstanceState);
34 | if (savedInstanceState != null) {
35 | mLayoutRes = savedInstanceState.getInt(KEY_LAYOUT_RES);
36 | mIsCancelOutside = savedInstanceState.getBoolean(KEY_CANCEL_OUTSIDE);
37 | }
38 | }
39 |
40 | @Override
41 | public void onSaveInstanceState(Bundle outState) {
42 | outState.putInt(KEY_LAYOUT_RES, mLayoutRes);
43 | outState.putBoolean(KEY_CANCEL_OUTSIDE, mIsCancelOutside);
44 | super.onSaveInstanceState(outState);
45 | }
46 |
47 | @Override
48 | public void bindView(View v) {
49 | if (mViewListener != null) {
50 | mViewListener.bindView(v);
51 | }
52 | }
53 |
54 | @Override
55 | public int getLayoutRes() {
56 | return mLayoutRes;
57 | }
58 |
59 | public BottomSheetDialog setFragmentManager(FragmentManager manager) {
60 | mFragmentManager = manager;
61 | return this;
62 | }
63 |
64 | public BottomSheetDialog setViewListener(ViewListener listener) {
65 | mViewListener = listener;
66 | return this;
67 | }
68 |
69 | public BottomSheetDialog setLayoutRes(@LayoutRes int layoutRes) {
70 | mLayoutRes = layoutRes;
71 | return this;
72 | }
73 |
74 | public BottomSheetDialog setCancelOutside(boolean cancel) {
75 | mIsCancelOutside = cancel;
76 | return this;
77 | }
78 |
79 | public BottomSheetDialog setTag(String tag) {
80 | mTag = tag;
81 | return this;
82 | }
83 |
84 | @Override
85 | public boolean getCancelOutside() {
86 | return mIsCancelOutside;
87 | }
88 |
89 | @Override
90 | public String getFragmentTag() {
91 | return mTag;
92 | }
93 |
94 | public interface ViewListener {
95 | void bindView(View v);
96 | }
97 |
98 | public BaseBottomSheetDialog show() {
99 | show(mFragmentManager);
100 | return this;
101 | }
102 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/behavior/bottombehaviormaster/view/CustomerVideoView.java:
--------------------------------------------------------------------------------
1 | package com.behavior.bottombehaviormaster.view;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 | import android.widget.VideoView;
6 |
7 | /**
8 | * @author Lix
9 | * @date 2020-02-01 21:00
10 | */
11 | public class CustomerVideoView extends VideoView {
12 |
13 | public CustomerVideoView(Context context) {
14 | super(context);
15 | }
16 |
17 | public CustomerVideoView(Context context, AttributeSet attrs) {
18 | super(context, attrs);
19 | }
20 |
21 | public CustomerVideoView(Context context, AttributeSet attrs, int defStyleAttr) {
22 | super(context, attrs, defStyleAttr);
23 | }
24 |
25 | @Override
26 | protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
27 | int width = getDefaultSize(0, widthMeasureSpec);
28 | int height = getDefaultSize(0, heightMeasureSpec);
29 | setMeasuredDimension(width, height);
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
12 |
13 |
19 |
22 |
25 |
26 |
27 |
28 |
34 |
35 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
15 |
20 |
25 |
30 |
35 |
40 |
45 |
50 |
55 |
60 |
65 |
70 |
75 |
80 |
85 |
90 |
95 |
100 |
105 |
110 |
115 |
120 |
125 |
130 |
135 |
140 |
145 |
150 |
155 |
160 |
165 |
170 |
171 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_test.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
11 |
12 |
13 |
22 |
23 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/view_comment_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
16 |
17 |
26 |
27 |
33 |
34 |
43 |
44 |
48 |
49 |
56 |
57 |
64 |
65 |
72 |
73 |
80 |
81 |
82 |
83 |
89 |
90 |
91 |
99 |
100 |
105 |
106 |
111 |
112 |
113 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/view_dialog_comment.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
12 |
13 |
17 |
18 |
27 |
28 |
35 |
36 |
41 |
42 |
43 |
44 |
49 |
50 |
54 |
55 |
56 |
57 |
62 |
63 |
75 |
76 |
88 |
89 |
90 |
91 |
98 |
99 |
105 |
106 |
107 |
108 |
109 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/futureLix/behavior/dc0a74f125c6646b0e4abfda9517f403f014ef4b/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/futureLix/behavior/dc0a74f125c6646b0e4abfda9517f403f014ef4b/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/futureLix/behavior/dc0a74f125c6646b0e4abfda9517f403f014ef4b/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/futureLix/behavior/dc0a74f125c6646b0e4abfda9517f403f014ef4b/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/futureLix/behavior/dc0a74f125c6646b0e4abfda9517f403f014ef4b/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/futureLix/behavior/dc0a74f125c6646b0e4abfda9517f403f014ef4b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/futureLix/behavior/dc0a74f125c6646b0e4abfda9517f403f014ef4b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/futureLix/behavior/dc0a74f125c6646b0e4abfda9517f403f014ef4b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/futureLix/behavior/dc0a74f125c6646b0e4abfda9517f403f014ef4b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/futureLix/behavior/dc0a74f125c6646b0e4abfda9517f403f014ef4b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #008577
4 | #00574B
5 | #D81B60
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | BottomBehaviorMaster
3 |
4 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/test/java/com/behavior/bottombehaviormaster/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.behavior.bottombehaviormaster;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | google()
6 | jcenter()
7 |
8 | }
9 | dependencies {
10 | classpath 'com.android.tools.build:gradle:3.5.3'
11 |
12 | // NOTE: Do not place your application dependencies here; they belong
13 | // in the individual module build.gradle files
14 | }
15 | }
16 |
17 | allprojects {
18 | repositories {
19 | google()
20 | jcenter()
21 | maven { url "https://jitpack.io" }
22 | }
23 | }
24 |
25 | task clean(type: Delete) {
26 | delete rootProject.buildDir
27 | }
28 |
--------------------------------------------------------------------------------
/gif/21134244-7e7a289febb2f094.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/futureLix/behavior/dc0a74f125c6646b0e4abfda9517f403f014ef4b/gif/21134244-7e7a289febb2f094.gif
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx1536m
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13 | # org.gradle.parallel=true
14 |
15 |
16 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/futureLix/behavior/dc0a74f125c6646b0e4abfda9517f403f014ef4b/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Sat Feb 01 20:17:48 CST 2020
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
7 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Attempt to set APP_HOME
10 | # Resolve links: $0 may be a link
11 | PRG="$0"
12 | # Need this for relative symlinks.
13 | while [ -h "$PRG" ] ; do
14 | ls=`ls -ld "$PRG"`
15 | link=`expr "$ls" : '.*-> \(.*\)$'`
16 | if expr "$link" : '/.*' > /dev/null; then
17 | PRG="$link"
18 | else
19 | PRG=`dirname "$PRG"`"/$link"
20 | fi
21 | done
22 | SAVED="`pwd`"
23 | cd "`dirname \"$PRG\"`/" >/dev/null
24 | APP_HOME="`pwd -P`"
25 | cd "$SAVED" >/dev/null
26 |
27 | APP_NAME="Gradle"
28 | APP_BASE_NAME=`basename "$0"`
29 |
30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31 | DEFAULT_JVM_OPTS=""
32 |
33 | # Use the maximum available, or set MAX_FD != -1 to use that value.
34 | MAX_FD="maximum"
35 |
36 | warn () {
37 | echo "$*"
38 | }
39 |
40 | die () {
41 | echo
42 | echo "$*"
43 | echo
44 | exit 1
45 | }
46 |
47 | # OS specific support (must be 'true' or 'false').
48 | cygwin=false
49 | msys=false
50 | darwin=false
51 | nonstop=false
52 | case "`uname`" in
53 | CYGWIN* )
54 | cygwin=true
55 | ;;
56 | Darwin* )
57 | darwin=true
58 | ;;
59 | MINGW* )
60 | msys=true
61 | ;;
62 | NONSTOP* )
63 | nonstop=true
64 | ;;
65 | esac
66 |
67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
68 |
69 | # Determine the Java command to use to start the JVM.
70 | if [ -n "$JAVA_HOME" ] ; then
71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
72 | # IBM's JDK on AIX uses strange locations for the executables
73 | JAVACMD="$JAVA_HOME/jre/sh/java"
74 | else
75 | JAVACMD="$JAVA_HOME/bin/java"
76 | fi
77 | if [ ! -x "$JAVACMD" ] ; then
78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
79 |
80 | Please set the JAVA_HOME variable in your environment to match the
81 | location of your Java installation."
82 | fi
83 | else
84 | JAVACMD="java"
85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
86 |
87 | Please set the JAVA_HOME variable in your environment to match the
88 | location of your Java installation."
89 | fi
90 |
91 | # Increase the maximum file descriptors if we can.
92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
93 | MAX_FD_LIMIT=`ulimit -H -n`
94 | if [ $? -eq 0 ] ; then
95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
96 | MAX_FD="$MAX_FD_LIMIT"
97 | fi
98 | ulimit -n $MAX_FD
99 | if [ $? -ne 0 ] ; then
100 | warn "Could not set maximum file descriptor limit: $MAX_FD"
101 | fi
102 | else
103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
104 | fi
105 | fi
106 |
107 | # For Darwin, add options to specify how the application appears in the dock
108 | if $darwin; then
109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
110 | fi
111 |
112 | # For Cygwin, switch paths to Windows format before running java
113 | if $cygwin ; then
114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
116 | JAVACMD=`cygpath --unix "$JAVACMD"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Escape application args
158 | save () {
159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
160 | echo " "
161 | }
162 | APP_ARGS=$(save "$@")
163 |
164 | # Collect all arguments for the java command, following the shell quoting and substitution rules
165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
166 |
167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
169 | cd "$(dirname "$0")"
170 | fi
171 |
172 | exec "$JAVACMD" "$@"
173 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | set DIRNAME=%~dp0
12 | if "%DIRNAME%" == "" set DIRNAME=.
13 | set APP_BASE_NAME=%~n0
14 | set APP_HOME=%DIRNAME%
15 |
16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17 | set DEFAULT_JVM_OPTS=
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windows variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 |
53 | :win9xME_args
54 | @rem Slurp the command line arguments.
55 | set CMD_LINE_ARGS=
56 | set _SKIP=2
57 |
58 | :win9xME_args_slurp
59 | if "x%~1" == "x" goto execute
60 |
61 | set CMD_LINE_ARGS=%*
62 |
63 | :execute
64 | @rem Setup the command line
65 |
66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67 |
68 | @rem Execute Gradle
69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70 |
71 | :end
72 | @rem End local scope for the variables with windows NT shell
73 | if "%ERRORLEVEL%"=="0" goto mainEnd
74 |
75 | :fail
76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77 | rem the _cmd.exe /c_ return code!
78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79 | exit /b 1
80 |
81 | :mainEnd
82 | if "%OS%"=="Windows_NT" endlocal
83 |
84 | :omega
85 |
--------------------------------------------------------------------------------
/mybehavior/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/mybehavior/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | android {
4 | compileSdkVersion 28
5 |
6 |
7 | defaultConfig {
8 | minSdkVersion 21
9 | targetSdkVersion 28
10 | versionCode 1
11 | versionName "1.0"
12 |
13 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
14 | consumerProguardFiles 'consumer-rules.pro'
15 | }
16 |
17 | buildTypes {
18 | release {
19 | minifyEnabled false
20 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
21 | }
22 | }
23 |
24 | }
25 |
26 | dependencies {
27 | implementation fileTree(dir: 'libs', include: ['*.jar'])
28 | api 'com.android.support:appcompat-v7:28.0.0'
29 | api 'com.android.support:design:28.0.0'
30 | api 'com.android.support.constraint:constraint-layout:1.1.3'
31 | api 'com.blankj:utilcode:1.13.10'
32 | api 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.42'
33 | api 'com.android.support.constraint:constraint-layout:1.1.3'
34 | testApi 'junit:junit:4.12'
35 | androidTestApi 'com.android.support.test:runner:1.0.2'
36 | androidTestApi 'com.android.support.test.espresso:espresso-core:3.0.2'
37 | }
38 |
--------------------------------------------------------------------------------
/mybehavior/consumer-rules.pro:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/futureLix/behavior/dc0a74f125c6646b0e4abfda9517f403f014ef4b/mybehavior/consumer-rules.pro
--------------------------------------------------------------------------------
/mybehavior/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/mybehavior/src/androidTest/java/com/behavior/mybehavior/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.behavior.mybehavior;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumented test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
23 |
24 | assertEquals("com.behavior.mybehavior.test", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/mybehavior/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
--------------------------------------------------------------------------------
/mybehavior/src/main/res/drawable/icon_comment_close.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/futureLix/behavior/dc0a74f125c6646b0e4abfda9517f403f014ef4b/mybehavior/src/main/res/drawable/icon_comment_close.png
--------------------------------------------------------------------------------
/mybehavior/src/main/res/drawable/icon_comment_zan.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/futureLix/behavior/dc0a74f125c6646b0e4abfda9517f403f014ef4b/mybehavior/src/main/res/drawable/icon_comment_zan.png
--------------------------------------------------------------------------------
/mybehavior/src/main/res/drawable/shape_dialog_send_comment_btn.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/mybehavior/src/main/res/raw/test.mp4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/futureLix/behavior/dc0a74f125c6646b0e4abfda9517f403f014ef4b/mybehavior/src/main/res/raw/test.mp4
--------------------------------------------------------------------------------
/mybehavior/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #00000000
4 | #FFFFFF
5 | #333333
6 |
7 | #FFFFFFFF
8 | #FCFFFFFF
9 | #FAFFFFFF
10 | #F7FFFFFF
11 | #F5FFFFFF
12 | #F2FFFFFF
13 | #F0FFFFFF
14 | #EDFFFFFF
15 | #EBFFFFFF
16 | #E8FFFFFF
17 | #E6FFFFFF
18 | #E3FFFFFF
19 | #FFFFFFFF
20 | #E0FFFFFF
21 | #DEFFFFFF
22 | #DBFFFFFF
23 | #D9FFFFFF
24 | #D6FFFFFF
25 | #D4FFFFFF
26 | #D1FFFFFF
27 | #CFFFFFFF
28 | #CCFFFFFF
29 | #C9FFFFFF
30 | #C7FFFFFF
31 | #C2FFFFFF
32 | #BFFFFFFF
33 | #BDFFFFFF
34 | #BAFFFFFF
35 | #B8FFFFFF
36 | #B5FFFFFF
37 | #B3FFFFFF
38 | #B0FFFFFF
39 | #ADFFFFFF
40 | #ABFFFFFF
41 | #A8FFFFFF
42 | #A6FFFFFF
43 | #A3FFFFFF
44 | #A1FFFFFF
45 | #9EFFFFFF
46 | #9CFFFFFF
47 | #99FFFFFF
48 | #96FFFFFF
49 | #94FFFFFF
50 | #91FFFFFF
51 | #8FFFFFFF
52 | #8CFFFFFF
53 | #87FFFFFF
54 | #85FFFFFF
55 | #82FFFFFF
56 | #80FFFFFF
57 | #7DFFFFFF
58 | #7AFFFFFF
59 | #78FFFFFF
60 | #75FFFFFF
61 | #73FFFFFF
62 | #70FFFFFF
63 | #6EFFFFFF
64 | #6BFFFFFF
65 | #66FFFFFF
66 | #63FFFFFF
67 | #61FFFFFF
68 | #5EFFFFFF
69 | #5CFFFFFF
70 | #59FFFFFF
71 | #57FFFFFF
72 | #54FFFFFF
73 | #52FFFFFF
74 | #4FFFFFFF
75 | #4DFFFFFF
76 | #4DFFFFFF
77 | #4DFFFFFF
78 | #4AFFFFFF
79 | #47FFFFFF
80 | #45FFFFFF
81 | #42FFFFFF
82 | #40FFFFFF
83 | #3BFFFFFF
84 | #38FFFFFF
85 | #36FFFFFF
86 | #33FFFFFF
87 | #30FFFFFF
88 | #2EFFFFFF
89 | #2BFFFFFF
90 | #29FFFFFF
91 | #26FFFFFF
92 | #24FFFFFF
93 | #21FFFFFF
94 | #1FFFFFFF
95 | #1CFFFFFF
96 | #1AFFFFFF
97 | #17FFFFFF
98 | #14FFFFFF
99 | #12FFFFFF
100 | #0FFFFFFF
101 | #0DFFFFFF
102 | #0AFFFFFF
103 | #08FFFFFF
104 | #05FFFFFF
105 | #03FFFFFF
106 | #00FFFFFF
107 |
108 | #FF000000
109 | #FC000000
110 | #FA000000
111 | #F7000000
112 | #F5000000
113 | #F2000000
114 | #F0000000
115 | #ED000000
116 | #EB000000
117 | #E8000000
118 | #E6000000
119 | #E3000000
120 | #FF000000
121 | #E0000000
122 | #DE000000
123 | #DB000000
124 | #D9000000
125 | #D6000000
126 | #D4000000
127 | #D1000000
128 | #CF000000
129 | #CC000000
130 | #C9000000
131 | #C7000000
132 | #C2000000
133 | #BF000000
134 | #BD000000
135 | #BA000000
136 | #B8000000
137 | #B5000000
138 | #B3000000
139 | #B0000000
140 | #AD000000
141 | #AB000000
142 | #A8000000
143 | #A6000000
144 | #A3000000
145 | #A1000000
146 | #9E000000
147 | #9C000000
148 | #99000000
149 | #96000000
150 | #94000000
151 | #91000000
152 | #8F000000
153 | #8C000000
154 | #87000000
155 | #85000000
156 | #82000000
157 | #80000000
158 | #7D000000
159 | #7A000000
160 | #78000000
161 | #75000000
162 | #73000000
163 | #70000000
164 | #6E000000
165 | #6B000000
166 | #66000000
167 | #63000000
168 | #61000000
169 | #5E000000
170 | #5C000000
171 | #59000000
172 | #57000000
173 | #54000000
174 | #52000000
175 | #4F000000
176 | #4D000000
177 | #4D000000
178 | #4D000000
179 | #4A000000
180 | #47000000
181 | #45000000
182 | #42000000
183 | #40000000
184 | #3B000000
185 | #38000000
186 | #36000000
187 | #33000000
188 | #30000000
189 | #2E000000
190 | #2B000000
191 | #29000000
192 | #26000000
193 | #24000000
194 | #21000000
195 | #1F000000
196 | #1C000000
197 | #1A000000
198 | #17000000
199 | #14000000
200 | #12000000
201 | #0F000000
202 | #0D000000
203 | #0A000000
204 | #08000000
205 | #05000000
206 | #03000000
207 | #00000000
208 |
209 |
--------------------------------------------------------------------------------
/mybehavior/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 | 16dp
3 |
4 | 15sp
5 | 14sp
6 | 15sp
7 | 14sp
8 | 15sp
9 | 12sp
10 |
11 |
--------------------------------------------------------------------------------
/mybehavior/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | MyBehavior
3 | com.behavior.mybehavior.BottomBehavior
4 | com.behavior.mybehavior.bottom.FollowBehavior
5 |
6 | 有爱评论,说点好听的~
7 | 发送
8 |
9 |
--------------------------------------------------------------------------------
/mybehavior/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
14 |
15 |
19 |
20 |
24 |
25 |
29 |
30 |
34 |
35 |
39 |
--------------------------------------------------------------------------------
/mybehavior/src/test/java/com/behavior/mybehavior/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.behavior.mybehavior;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app', ':mybehavior'
2 | rootProject.name='BottomBehaviorMaster'
3 |
--------------------------------------------------------------------------------