Skip to content

Commit 89da78d

Browse files
atm1504mariobehling
authored andcommitted
feat: Add back button in chat search activity (#2358)
* feat: Add back button in chat search activity * feat: Show query in actionbar
1 parent 18eab36 commit 89da78d

File tree

4 files changed

+9
-18
lines changed

4 files changed

+9
-18
lines changed

app/src/main/AndroidManifest.xml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,12 @@
2222
android:theme="@style/AppTheme"
2323
android:networkSecurityConfig="@xml/network_security_config"
2424
android:vmSafeMode="true">
25-
<activity android:name=".chat.search.ChatSearchActivity"></activity>
25+
<activity android:name=".chat.search.ChatSearchActivity"
26+
android:configChanges="orientation|screenSize"
27+
android:theme="@style/PreferencesThemeLight">
28+
<meta-data
29+
android:name="android.support.PARENT_ACTIVITY"
30+
android:value="org.fossasia.susi.ai.chat.search.ChatSearchActivity" /></activity>
2631
<activity
2732
android:name=".login.WelcomeActivity"
2833
android:theme="@style/PreferenceFixTheme.DayNight.NoActionBar">

app/src/main/java/org/fossasia/susi/ai/chat/search/ChatSearchActivity.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import org.fossasia.susi.ai.data.db.DatabaseRepository
1111
import android.content.Intent
1212
import android.view.View
1313
import android.widget.Toast
14-
import kotlinx.android.synthetic.main.activity_chat_search.chatSearchToolbar
1514
import kotlinx.android.synthetic.main.activity_chat_search.search_not_found
1615
import org.fossasia.susi.ai.chat.ChatActivity
1716

@@ -29,7 +28,8 @@ class ChatSearchActivity : AppCompatActivity() {
2928
super.onCreate(savedInstanceState)
3029
var bundle: Bundle ? = intent.extras
3130
query = bundle?.getString("query") as String
32-
setSupportActionBar(chatSearchToolbar)
31+
32+
this.title = getString(R.string.search_results) + " - " + query
3333

3434
setContentView(R.layout.activity_chat_search)
3535
loadQueryList(realm, query)

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

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,6 @@
77
android:orientation="vertical"
88
tools:context="org.fossasia.susi.ai.chat.search.ChatSearchActivity">
99

10-
<android.support.design.widget.AppBarLayout
11-
android:layout_width="match_parent"
12-
android:layout_height="wrap_content"
13-
android:theme="@style/AppTheme.AppBarOverlay">
14-
15-
<android.support.v7.widget.Toolbar
16-
android:id="@+id/chatSearchToolbar"
17-
android:layout_width="match_parent"
18-
android:layout_height="?attr/actionBarSize"
19-
android:background="?attr/colorPrimary"
20-
app:popupTheme="@style/AppTheme.PopupOverlay"
21-
app:title="Search Results" />
22-
23-
</android.support.design.widget.AppBarLayout>
24-
2510
<FrameLayout
2611
android:layout_width="match_parent"
2712
android:layout_height="match_parent">

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,7 @@
567567
\nYou agree that the laws of Can Tho, Vietnam will apply to any disputes arising out of or relating to these terms or the Services. All claims arising out of or relating to these terms or the services will be litigated exclusively in the courts of Can Tho City, Vietnam, and you and SUSI consent to personal jurisdiction in those courts.
568568
\nFor information about how to contact SUSI, please visit our contact page.</string>
569569
<string name="title_activity_chat_search_main">ChatSearchMainActivity</string>
570+
<string name="search_results">Search Results</string>
570571
<string name="settings_help">Help</string>
571572
<string name="settings_help_key">help</string>
572573
<string name="settings_privacy">Privacy</string>

0 commit comments

Comments
 (0)