mirror of
https://github.com/leaf-wai/StackLayoutManager.git
synced 2026-03-16 01:22:50 +08:00
Update Sample
change toobar title when recyclerview scroll to new item.
This commit is contained in:
BIN
.idea/caches/build_file_checksums.ser
generated
BIN
.idea/caches/build_file_checksums.ser
generated
Binary file not shown.
14
.idea/misc.xml
generated
14
.idea/misc.xml
generated
@ -1,19 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CheckStyle-IDEA">
|
||||
<option name="configuration">
|
||||
<map>
|
||||
<entry key="active-configuration" value="BUNDLED:(bundled):Google Checks" />
|
||||
<entry key="checkstyle-version" value="8.7" />
|
||||
<entry key="copy-libs" value="false" />
|
||||
<entry key="location-0" value="BUNDLED:(bundled):Sun Checks" />
|
||||
<entry key="location-1" value="BUNDLED:(bundled):Google Checks" />
|
||||
<entry key="scan-before-checkin" value="false" />
|
||||
<entry key="scanscope" value="JavaOnly" />
|
||||
<entry key="suppress-errors" value="false" />
|
||||
</map>
|
||||
</option>
|
||||
</component>
|
||||
<component name="NullableNotNullManager">
|
||||
<option name="myDefaultNullable" value="android.support.annotation.Nullable" />
|
||||
<option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
|
||||
|
||||
@ -8,8 +8,8 @@ android {
|
||||
defaultConfig {
|
||||
minSdkVersion 14
|
||||
targetSdkVersion 27
|
||||
versionCode 3
|
||||
versionName "1.0.2"
|
||||
versionCode 4
|
||||
versionName "1.0.3"
|
||||
|
||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||
|
||||
@ -46,7 +46,7 @@ publish{
|
||||
userOrg = 'jinliancheng120'
|
||||
groupId = 'com.littlemango'
|
||||
artifactId = 'stacklayoutmanager'
|
||||
publishVersion = '1.0.2'
|
||||
publishVersion = '1.0.3'
|
||||
desc = 'A RecyclerView.LayoutManager implementation which provides functionality to show a group of stack view.'
|
||||
website = 'https://github.com/LittleMango/StackLayoutManager'
|
||||
licences = ['MIT']
|
||||
|
||||
@ -1,13 +1,13 @@
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
|
||||
buildscript {
|
||||
ext.kotlin_version = '1.2.50'
|
||||
ext.kotlin_version = '1.2.60'
|
||||
repositories {
|
||||
google()
|
||||
jcenter()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:3.1.3'
|
||||
classpath 'com.android.tools.build:gradle:3.1.4'
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
classpath 'com.novoda:bintray-release:0.8.1'
|
||||
}
|
||||
|
||||
@ -68,18 +68,22 @@ public class MainActivity extends AppCompatActivity {
|
||||
case 2:
|
||||
mStackLayoutManager = new StackLayoutManager(ScrollOrientation.LEFT_TO_RIGHT);
|
||||
mRecyclerView.setLayoutManager(mStackLayoutManager);
|
||||
getSupportActionBar().setTitle("Picture 0");
|
||||
break;
|
||||
case 3:
|
||||
mStackLayoutManager = new StackLayoutManager(ScrollOrientation.RIGHT_TO_LEFT);
|
||||
mRecyclerView.setLayoutManager(mStackLayoutManager);
|
||||
getSupportActionBar().setTitle("Picture 0");
|
||||
break;
|
||||
case 4:
|
||||
mStackLayoutManager = new StackLayoutManager(ScrollOrientation.TOP_TO_BOTTOM);
|
||||
mRecyclerView.setLayoutManager(mStackLayoutManager);
|
||||
getSupportActionBar().setTitle("Picture 0");
|
||||
break;
|
||||
case 5:
|
||||
mStackLayoutManager = new StackLayoutManager(ScrollOrientation.BOTTOM_TO_TOP);
|
||||
mRecyclerView.setLayoutManager(mStackLayoutManager);
|
||||
getSupportActionBar().setTitle("Picture 0");
|
||||
break;
|
||||
case 6:
|
||||
mStackLayoutManager.setPagerMode(!mStackLayoutManager.getPagerMode());
|
||||
@ -112,6 +116,13 @@ public class MainActivity extends AppCompatActivity {
|
||||
mStackLayoutManager.requestLayout();
|
||||
break;
|
||||
}
|
||||
|
||||
mStackLayoutManager.setItemChangedListener(new StackLayoutManager.ItemChangedListener() {
|
||||
@Override
|
||||
public void onItemChanged(int position) {
|
||||
getSupportActionBar().setTitle("Picture " + position);
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
.show();
|
||||
@ -121,8 +132,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
mStackLayoutManager.setItemChangedListener(new StackLayoutManager.ItemChangedListener() {
|
||||
@Override
|
||||
public void onItemChanged(int position) {
|
||||
mToast.setText("first visible item position is " + position);
|
||||
mToast.show();
|
||||
getSupportActionBar().setTitle("Picture " + position);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user