Skip to content

Commit d7705c0

Browse files
committed
Some fiw with code style
1 parent 9310590 commit d7705c0

File tree

5 files changed

+13
-22
lines changed

5 files changed

+13
-22
lines changed

app/build.gradle

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,7 @@ android {
2626

2727
dependencies {
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
}

app/src/main/AndroidManifest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
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>

app/src/main/java/ru/whalemare/bottomsheet/MainActivityKotlin.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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)

sheetmenu/build.gradle

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@ apply plugin: 'com.android.library'
22
apply plugin: 'kotlin-android'
33
apply 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

710
android {
811
compileSdkVersion 25
912
buildToolsVersion "25.0.3"
10-
1113
defaultConfig {
1214
minSdkVersion 19
1315
targetSdkVersion 25
@@ -31,14 +33,10 @@ android {
3133

3234
dependencies {
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
}
4341
repositories {
4442
mavenCentral()

sheetmenu/src/main/java/ru/whalemare/sheetmenu/SheetMenu.kt

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)