Skip to content
This repository was archived by the owner on Jun 8, 2024. It is now read-only.

Commit 14917aa

Browse files
committed
New UI: Show different tips in home fragments
Signed-off-by: Fung <fython@163.com>
1 parent 045a4b1 commit 14917aa

7 files changed

Lines changed: 21 additions & 2 deletions

File tree

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
org.gradle.jvmargs=-Xmx1536m
22
BUILD_TOOLS_VERSION=26.0.1
3-
VERSION_NAME=2.9.9 Beta 3
3+
VERSION_NAME=3.0.0
44
TARGET_SDK_VERSION=26
5-
VERSION_CODE=43
5+
VERSION_CODE=46
66
MIN_SDK_VERSION=21

mobile/src/main/kotlin/info/papdt/express/helper/ui/fragment/home/BaseFragment.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import android.support.v7.widget.LinearLayoutManager
99
import android.support.v7.widget.RecyclerView
1010
import android.view.View
1111
import android.widget.LinearLayout
12+
import android.widget.TextView
1213

1314
import com.scwang.smartrefresh.layout.SmartRefreshLayout
1415

@@ -30,6 +31,7 @@ abstract class BaseFragment : AbsFragment, OnRefreshListener {
3031
private lateinit var mRecyclerView: AnimatedRecyclerView
3132
private lateinit var mEmptyView: LinearLayout
3233
lateinit var mSwipeHeader: DeliveryHeader
34+
protected lateinit var mEmptyTips: TextView
3335

3436
private var mAdapter: RecyclerView.Adapter<*>? = null
3537

@@ -69,6 +71,7 @@ abstract class BaseFragment : AbsFragment, OnRefreshListener {
6971
mRecyclerView = view.findViewById(R.id.recycler_view)
7072
mEmptyView = view.findViewById(R.id.empty_view)
7173
mSwipeHeader = view.findViewById(R.id.refresh_header)
74+
mEmptyTips = view.findViewById(R.id.frame_empty_tip)
7275

7376
// Set up mRecyclerView
7477
mRecyclerView.setHasFixedSize(false)

mobile/src/main/kotlin/info/papdt/express/helper/ui/fragment/home/FragmentAll.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package info.papdt.express.helper.ui.fragment.home
22

33
import android.annotation.SuppressLint
44
import android.os.Bundle
5+
import info.papdt.express.helper.R
56

67
import info.papdt.express.helper.dao.PackageDatabase
78
import info.papdt.express.helper.ui.adapter.HomePackageListAdapter
@@ -16,6 +17,11 @@ class FragmentAll : BaseFragment {
1617
override fun setUpAdapter() {
1718
val adapter = HomePackageListAdapter(database, arguments.getInt(ARG_TYPE), mainActivity)
1819
setAdapter(adapter)
20+
when (arguments.getInt(ARG_TYPE)) {
21+
TYPE_ALL -> mEmptyTips.setText(R.string.frame_empty_tip_all)
22+
TYPE_DELIVERED -> mEmptyTips.setText(R.string.frame_empty_tip_delivered)
23+
TYPE_DELIVERING -> mEmptyTips.setText(R.string.frame_empty_tip_delivering)
24+
}
1925
}
2026

2127
override val fragmentId: Int

mobile/src/main/res/layout/fragment_home.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
<android.support.v7.widget.AppCompatTextView
4444
android:layout_width="wrap_content"
4545
android:layout_height="wrap_content"
46+
android:id="@+id/frame_empty_tip"
4647
android:text="@string/frame_empty_tip"
4748
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
4849
android:alpha="0.5"/>

mobile/src/main/res/values-zh-rCN/strings.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
<string name="navigation_item_delivered">已送达</string>
1212
<string name="navigation_item_on_the_way">运输中</string>
1313
<string name="frame_empty_tip">点击 “添加” 按钮新增快递包裹</string>
14+
<string name="frame_empty_tip_delivering">没有运输中的包裹</string>
15+
<string name="frame_empty_tip_delivered">没有已送达的包裹</string>
16+
<string name="frame_empty_tip_all">你可以通过搜索栏添加包裹</string>
1417

1518
<string name="action_search">搜索</string>
1619
<string name="action_read_all">全部标记为已读</string>

mobile/src/main/res/values-zh-rTW/strings.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
<string name="navigation_item_delivered">已送達</string>
1212
<string name="navigation_item_on_the_way">運輸中</string>
1313
<string name="frame_empty_tip">點擊 “添加” 按鈕新增速遞包裹</string>
14+
<string name="frame_empty_tip_delivering">沒有運輸中的包裹</string>
15+
<string name="frame_empty_tip_delivered">沒有已送達的包裹</string>
16+
<string name="frame_empty_tip_all">你可以通过搜尋欄添加包裹</string>
1417

1518
<string name="action_search">搜尋</string>
1619
<string name="action_read_all">全部標為已讀</string>

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
<string name="navigation_item_delivered">Delivered</string>
1919
<string name="navigation_item_on_the_way">On the way</string>
2020
<string name="frame_empty_tip">Click \"Add\" button to add packages</string>
21+
<string name="frame_empty_tip_delivering">No package delivering</string>
22+
<string name="frame_empty_tip_delivered">No package delivered</string>
23+
<string name="frame_empty_tip_all">You can add a package from search box</string>
2124

2225
<string name="action_search">Search</string>
2326
<string name="action_read_all">Mark all read</string>

0 commit comments

Comments
 (0)