File tree Expand file tree Collapse file tree 5 files changed +13
-22
lines changed
java/ru/whalemare/bottomsheet Expand file tree Collapse file tree 5 files changed +13
-22
lines changed Original file line number Diff line number Diff line change @@ -26,11 +26,7 @@ android {
2626
2727dependencies {
2828 compile fileTree(dir : ' libs' , include : [' *.jar' ])
29- androidTestCompile(' com.android.support.test.espresso:espresso-core:2.2.2' , {
30- exclude group : ' com.android.support' , module : ' support-annotations'
31- })
3229 compile project(path : ' :sheetmenu' )
3330 compile ' com.android.support:appcompat-v7:25.3.1'
3431 compile ' com.android.support.constraint:constraint-layout:1.0.2'
35- testCompile ' junit:junit:4.12'
3632}
Original file line number Diff line number Diff line change 1010 android : supportsRtl =" true"
1111 android : theme =" @style/AppTheme" >
1212 <activity android : name =" .MainActivity" >
13+ </activity >
14+ <activity android : name =" .MainActivityKotlin" >
1315 <intent-filter >
1416 <action android : name =" android.intent.action.MAIN" />
1517
1618 <category android : name =" android.intent.category.LAUNCHER" />
1719 </intent-filter >
1820 </activity >
19- <activity android : name =" .MainActivityKotlin" >
20- </activity >
2121 </application >
2222
2323</manifest >
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ open class MainActivityKotlin : AppCompatActivity() {
2020 fun setup () {
2121 SheetMenu ().apply {
2222 titleId = R .string.title
23- layoutManager = GridLayoutManager (this @MainActivityKotlin, 3 )
23+ layoutManager = GridLayoutManager (this @MainActivityKotlin, 2 )
2424 click = MenuItem .OnMenuItemClickListener { true }
2525 menu = R .menu.menu
2626 }.show(this )
Original file line number Diff line number Diff line change @@ -2,12 +2,14 @@ apply plugin: 'com.android.library'
22apply plugin : ' kotlin-android'
33apply plugin : ' com.github.dcendents.android-maven'
44
5- group= ' com.github.whalemare'
5+ group = ' com.github.whalemare'
6+
7+ sourceCompatibility = 1.7
8+ targetCompatibility = 1.7
69
710android {
811 compileSdkVersion 25
912 buildToolsVersion " 25.0.3"
10-
1113 defaultConfig {
1214 minSdkVersion 19
1315 targetSdkVersion 25
@@ -31,14 +33,10 @@ android {
3133
3234dependencies {
3335 compile fileTree(dir : ' libs' , include : [' *.jar' ])
34- androidTestCompile(' com.android.support.test.espresso:espresso-core:2.2.2' , {
35- exclude group : ' com.android.support' , module : ' support-annotations'
36- })
3736 compile ' com.android.support:appcompat-v7:25.3.1'
3837 compile ' com.android.support:design:25.3.1'
39- testCompile ' junit:junit:4.12'
4038 compile " org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version "
41- compile ' com.github.jitpack:gradle-simple:master-SNAPSHOT'
39+ // compile 'com.github.jitpack:gradle-simple:master-SNAPSHOT'
4240}
4341repositories {
4442 mavenCentral()
Original file line number Diff line number Diff line change @@ -55,14 +55,11 @@ open class SheetMenu(
5555
5656 open protected fun processRecycler (recycler : RecyclerView ) {
5757 if (menu > 0 ) {
58- recycler.apply {
59- adapter = ListAdapter .with (context.inflate(menu)).apply {
60- callback = click
61- }
62- if (layoutManager == null ) {
63- layoutManager = LinearLayoutManager (context, LinearLayoutManager .VERTICAL , false )
64- }
58+ recycler.adapter = ListAdapter .with (recycler.context.inflate(menu)).apply {
59+ callback = click
6560 }
61+ recycler.layoutManager = layoutManager ? :
62+ LinearLayoutManager (recycler.context, LinearLayoutManager .VERTICAL , false )
6663 }
6764 }
6865
@@ -125,6 +122,6 @@ open class SheetMenu(
125122 return this
126123 }
127124 }
128- // endregion
125+ // endregion
129126}
130127
You can’t perform that action at this time.
0 commit comments