Skip to content

Commit 54f9f97

Browse files
committed
updated dependencies
1 parent c351cfd commit 54f9f97

File tree

12 files changed

+66
-62
lines changed

12 files changed

+66
-62
lines changed

app/build.gradle

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,16 @@ apply plugin: 'kotlin-android-extensions'
66

77
android {
88
compileSdkVersion 28
9+
910
defaultConfig {
10-
applicationId "searchview.danbroid.searchviewdemo2"
11+
applicationId "danbroid.searchviewdemo"
1112
minSdkVersion 15
1213
targetSdkVersion 28
13-
versionCode 1
14-
versionName "1.0"
14+
versionCode 4
15+
versionName "1.04"
1516
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1617
}
18+
1719
buildTypes {
1820
release {
1921
minifyEnabled false
@@ -34,7 +36,6 @@ project.afterEvaluate {
3436
}
3537

3638

37-
3839
dependencies {
3940
implementation "org.slf4j:slf4j-api:1.7.25"
4041

@@ -45,10 +46,9 @@ dependencies {
4546
//implementation "org.slf4j:slf4j-android:1.7.25"
4647

4748
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
48-
implementation 'androidx.appcompat:appcompat:1.0.0-rc01'
49-
implementation 'androidx.constraintlayout:constraintlayout:1.1.2'
50-
implementation 'com.google.android.material:material:1.0.0-rc01'
51-
testImplementation 'junit:junit:4.12'
52-
androidTestImplementation 'androidx.test:runner:1.1.0-rc01'
53-
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-alpha4'
49+
implementation 'androidx.appcompat:appcompat:1.0.2'
50+
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
51+
implementation 'com.google.android.material:material:1.0.0'
52+
implementation 'com.github.arimorty:floatingsearchview:2.1.1'
53+
5454
}

app/src/androidTest/java/searchview/danbroid/searchviewdemo2/ExampleInstrumentedTest.kt

Lines changed: 0 additions & 24 deletions
This file was deleted.

app/src/main/AndroidManifest.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,13 @@
7070

7171
</activity>
7272

73+
<activity
74+
android:name=".demo5.Demo5Activity"
75+
android:label="@string/title_demo5"
76+
android:launchMode="singleTop"
77+
android:theme="@style/AppTheme.NoActionBar">
78+
</activity>
79+
7380

7481
<provider
7582
android:name="danbroid.searchviewdemo.CheeseSuggestionsProvider"

app/src/main/java/danbroid/searchviewdemo/BaseActivity.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,9 @@ abstract class BaseActivity : AppCompatActivity() {
110110
protected fun closeSearchView() {
111111
menu?.findItem(R.id.action_search)?.let {
112112
if (it.isActionViewExpanded) {
113-
it.collapseActionView()
114-
it.actionView.clearFocus()
113+
/*it.actionView.clearFocus()
114+
it.collapseActionView()*/
115+
invalidateOptionsMenu()
115116
}
116117
}
117118
}

app/src/main/java/danbroid/searchviewdemo/CheeseData.kt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
package danbroid.searchviewdemo
22

3-
import android.app.SearchManager
43
import android.content.Context
5-
import android.database.Cursor
6-
import android.database.MatrixCursor
7-
import android.provider.BaseColumns
84
import android.text.TextUtils
95
import java.io.BufferedReader
106
import java.io.InputStreamReader

app/src/main/java/danbroid/searchviewdemo/MainActivity.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import danbroid.searchviewdemo.demo1.Demo1Activity
77
import danbroid.searchviewdemo.demo2.Demo2Activity
88
import danbroid.searchviewdemo.demo3.Demo3Activity
99
import danbroid.searchviewdemo.demo4.Demo4Activity
10+
import danbroid.searchviewdemo.demo5.Demo5Activity
1011

1112

1213
class MainActivity : BaseActivity() {
@@ -26,9 +27,13 @@ class MainActivity : BaseActivity() {
2627
startActivity(Intent(this, Demo1Activity::class.java))
2728
}
2829

29-
addButton("Demo4") {
30+
addButton("Search Dialog") {
3031
startActivity(Intent(this, Demo4Activity::class.java))
3132
}
33+
34+
addButton("Floating Search") {
35+
startActivity(Intent(this, Demo5Activity::class.java))
36+
}
3237
}
3338

3439
override fun configureSearchMenu(menuItem: MenuItem) {
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package danbroid.searchviewdemo.demo5
2+
3+
import android.view.MenuItem
4+
import android.view.View
5+
import danbroid.searchviewdemo.BaseActivity
6+
import danbroid.searchviewdemo.R
7+
import kotlinx.android.synthetic.main.activity.*
8+
9+
10+
private val log by lazy {
11+
org.slf4j.LoggerFactory.getLogger(Demo5Activity::class.java)
12+
}
13+
14+
class Demo5Activity : BaseActivity() {
15+
16+
override fun configureSearchMenu(menuItem: MenuItem) {
17+
}
18+
19+
override fun onOptionsItemSelected(item: MenuItem) = when (item.itemId) {
20+
R.id.action_search -> {
21+
floating_search_view.visibility = View.VISIBLE
22+
toolbar.visibility = View.GONE
23+
true
24+
}
25+
else -> super.onOptionsItemSelected(item)
26+
}
27+
28+
29+
}

app/src/main/res/layout/activity.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@
2020

2121
</com.google.android.material.appbar.AppBarLayout>
2222

23+
<com.arlib.floatingsearchview.FloatingSearchView
24+
android:id="@+id/floating_search_view"
25+
android:layout_width="match_parent"
26+
android:layout_height="wrap_content"
27+
app:floatingSearch_leftActionMode="showHamburger"
28+
android:fitsSystemWindows="true"
29+
android:visibility="gone" />
2330

2431
<LinearLayout
2532
android:id="@+id/content_container"

app/src/main/res/values/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@
77
<string name="title_demo2">Demo 2</string>
88
<string name="title_demo3">Demo 3</string>
99
<string name="title_demo4">Demo4</string>
10+
<string name="title_demo5">Demo5</string>
1011
</resources>

app/src/test/java/searchview/danbroid/searchviewdemo2/ExampleUnitTest.kt

Lines changed: 0 additions & 17 deletions
This file was deleted.

build.gradle

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22

33
buildscript {
4-
ext.kotlin_version = '1.2.60'
4+
ext.kotlin_version = '1.3.11'
55
repositories {
66
google()
77
jcenter()
88
}
99
dependencies {
10-
classpath 'com.android.tools.build:gradle:3.3.0-alpha05'
10+
classpath 'com.android.tools.build:gradle:3.3.0'
1111
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1212

1313
// NOTE: Do not place your application dependencies here; they belong
@@ -20,7 +20,6 @@ allprojects {
2020
google()
2121
jcenter()
2222
maven { url 'https://jitpack.io' }
23-
2423
}
2524
}
2625

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)