UI: prepare for advanced package manager

This commit is contained in:
zt515 2017-11-03 02:18:50 +08:00
parent ef72e7b148
commit abfc49aed0
6 changed files with 65 additions and 17 deletions

View File

@ -130,6 +130,7 @@ public final class BaseFileInstaller {
if (symlinks.isEmpty())
throw new RuntimeException("No SYMLINKS.txt encountered");
for (Pair<String, String> symlink : symlinks) {
NLog.INSTANCE.e("Setup", "Linking " + symlink.first + " to " + symlink.second);
Os.symlink(symlink.first, symlink.second);
}

View File

@ -49,12 +49,12 @@ class PackageManagerActivity : AppCompatActivity(), SearchView.OnQueryTextListen
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.ui_pm)
setContentView(R.layout.ui_pm_single_tab)
val toolbar = findViewById<Toolbar>(R.id.pm_toolbar)
setSupportActionBar(toolbar)
supportActionBar?.setDisplayHomeAsUpEnabled(true)
recyclerView = findViewById(R.id.package_list)
recyclerView = findViewById(R.id.pm_package_list)
recyclerView.setHasFixedSize(true)
adapter = PackageAdapter(this, COMPARATOR, object : PackageAdapter.Listener {
override fun onModelClicked(model: PackageModel) {

View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<com.simplecityapps.recyclerview_fastscroll.views.FastScrollRecyclerView
android:id="@+id/pm_package_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:fastScrollAutoHide="true"
app:fastScrollAutoHideDelay="1000"
app:fastScrollPopupBgColor="@color/colorAccent"
app:fastScrollPopupTextColor="@android:color/primary_text_dark"
app:fastScrollThumbColor="@color/colorAccent" />
</LinearLayout>

View File

@ -1,27 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/terminal_background"
android:orientation="vertical">
<android.support.v7.widget.Toolbar
android:id="@+id/pm_toolbar"
<LinearLayout
android:id="@+id/pm_tab_header"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/colorPrimary"
android:theme="@style/ThemeOverlay.AppCompat.Dark"
app:popupTheme="@style/ThemeOverlay.AppCompat.Dark" />
android:layout_height="wrap_content"
android:orientation="vertical">
<com.simplecityapps.recyclerview_fastscroll.views.FastScrollRecyclerView
android:id="@+id/package_list"
<android.support.v7.widget.Toolbar
android:id="@+id/pm_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/colorPrimary"
android:theme="@style/ThemeOverlay.AppCompat.Dark"
app:popupTheme="@style/ThemeOverlay.AppCompat.Dark" />
<io.neoterm.ui.pm.view.RecyclerTabLayout
android:id="@+id/pm_tab_layout"
android:layout_width="match_parent"
android:layout_height="@dimen/recycler_tab_height"
android:background="@color/colorPrimary" />
</LinearLayout>
<android.support.v4.view.ViewPager
android:id="@+id/pm_view_pager"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:fastScrollPopupBgColor="@color/colorAccent"
app:fastScrollPopupTextColor="@android:color/primary_text_dark"
app:fastScrollThumbColor="@color/colorAccent"
app:fastScrollAutoHide="true"
app:fastScrollAutoHideDelay="1000"/>
android:layout_below="@id/pm_tab_header"/>
</LinearLayout>
</RelativeLayout>

View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/terminal_background"
android:orientation="vertical">
<android.support.v7.widget.Toolbar
android:id="@+id/pm_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/colorPrimary"
android:theme="@style/ThemeOverlay.AppCompat.Dark"
app:popupTheme="@style/ThemeOverlay.AppCompat.Dark" />
<include layout="@layout/layout_pm_package_list" />
</LinearLayout>

View File

@ -13,6 +13,7 @@
<dimen name="min_popup_height">24dp</dimen>
<dimen name="popup_padding">4dp</dimen>
<dimen name="md_list_item_height">48dp</dimen>
<dimen name="recycler_tab_height">48dp</dimen>
<dimen name="package_item_padding">16dp</dimen>
<dimen name="color_item_padding">4dp</dimen>