Skip to content

Commit

Permalink
添加自定义源的使用引导
Browse files Browse the repository at this point in the history
UI: 在主页添加使用指引,修改“手动添加”为“本地调试”。
  • Loading branch information
xz-dev committed Aug 2, 2019
1 parent b3a8909 commit c024441
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.appcompat.app.ActionBar;
Expand Down Expand Up @@ -93,6 +95,9 @@ private void refreshHubList() {
itemCardViewList.add(new ItemCardView.Builder(null, null, null).extraData(extraData).build());
setRecyclerView();
adapter.notifyDataSetChanged();
} else {
TextView guidelinesTextView = findViewById(R.id.guidelinesTextView);
guidelinesTextView.setVisibility(View.VISIBLE);
}
}

Expand Down
13 changes: 13 additions & 0 deletions app/src/main/res/layout/activity_hub.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,19 @@

<include layout="@layout/content_list" />

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">

<TextView
android:id="@+id/guidelinesTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="@string/usage_guidelines_hub"
android:visibility="gone" />
</RelativeLayout>

<io.github.kobakei.materialfabspeeddial.FabSpeedDial
android:id="@+id/addFab"
android:layout_width="wrap_content"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="@string/usage_guidelines" />
android:text="@string/usage_guidelines_main" />
</RelativeLayout>

</androidx.coordinatorlayout.widget.CoordinatorLayout>
2 changes: 1 addition & 1 deletion app/src/main/res/menu/menu_tab_hub.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/add_local"
android:title="@string/add_manually"
android:title="@string/local_debug"
android:icon="@drawable/ic_add_2"
android:orderInCategory="1"/>
<item
Expand Down
5 changes: 3 additions & 2 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<string name="title_dashboard">Dashboard</string>
<string name="title_notifications">Notifications</string>
<string name="title_activity_log">日志</string>
<string name="add_manually">手动添加</string>
<string name="local_debug">本地调试</string>
<string name="cloud_hub">云端仓库</string>
<string name="download">下载</string>
<string name="end">End</string>
Expand All @@ -76,6 +76,7 @@
<string name="save_to_database">保存到数据库</string>
<string name="save_to_file_and_database">保存到文件与数据库</string>
<string name="main_program">主程序</string>
<string name="usage_guidelines"><![CDATA[这里好像什么也没有(>﹏<)\n点开右上角菜单看看帮助文档吧~]]></string>
<string name="usage_guidelines_main"><![CDATA[这里好像什么也没有(>﹏<)\n点开右上角菜单看看帮助文档吧~]]></string>
<string name="usage_guidelines_hub">Tips:点击右下角 + 添加云端规则~</string>

</resources>

0 comments on commit c024441

Please sign in to comment.