Skip to content

Commit

Permalink
New style update for Profile Ops OpRemind etc
Browse files Browse the repository at this point in the history
  • Loading branch information
Tornaco committed Sep 17, 2021
1 parent d77e35c commit 2e50dcf
Show file tree
Hide file tree
Showing 10 changed files with 240 additions and 185 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/appbar"
app:layout_behavior="@string/appbar_scrolling_view_behavior">

<FrameLayout
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ private void setupView() {
binding.swipe.setColorSchemeColors(getResources().getIntArray(github.tornaco.android.thanos.module.common.R.array.common_swipe_refresh_colors));

// Switch.
onSetupSwitchBar(binding.switchBar);
onSetupSwitchBar(binding.switchBarContainer.switchBar);

binding.fab.setOnClickListener(v -> {
ThanosManager.from(getApplicationContext())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class DataBindingAdapters {

@SuppressWarnings({"unchecked", "ConstantConditions"})
@BindingAdapter("android:replacements")
public static void setReplacements(RecyclerView view, List<ActivityTrampolineModel> models) {
public static void bindReplacements(RecyclerView view, List<ActivityTrampolineModel> models) {
Consumer<List<ActivityTrampolineModel>> consumer = (Consumer<List<ActivityTrampolineModel>>) view.getAdapter();
consumer.accept(models);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,84 +1,97 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">

<data>

<import type="android.view.View" />

<variable
name="viewModel"
type="github.tornaco.android.thanox.module.activity.trampoline.TrampolineViewModel" />
name="viewModel"
type="github.tornaco.android.thanox.module.activity.trampoline.TrampolineViewModel" />
</data>


<RelativeLayout
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent">


<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="@dimen/common_coll_appbar_height"
android:layout_alignParentTop="true"
android:background="?colorPrimary"
android:theme="?appbarTheme"
app:elevation="@dimen/common_toolbar_elevation">

<com.google.android.material.appbar.AppBarLayout app:elevation="@dimen/common_toolbar_elevation"
android:id="@+id/appbar"
<com.google.android.material.appbar.CollapsingToolbarLayout
android:id="@+id/toolbar_layout"
style="@style/Widget.MaterialComponents.Toolbar.Primary"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:background="?colorPrimary"
android:theme="?appbarTheme">
android:layout_height="match_parent"
android:fitsSystemWindows="true"
app:collapsedTitleTextAppearance="@style/ToolbarCollapsedTitleTextAppearance"
app:contentScrim="?attr/colorPrimary"
app:expandedTitleTextAppearance="@style/ToolbarExpandedTitleTextAppearance"
app:layout_scrollFlags="scroll|exitUntilCollapsed"
app:titleCollapseMode="scale"
app:toolbarId="@+id/toolbar">

<androidx.appcompat.widget.Toolbar
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?actionBarSize"
app:layout_collapseMode="pin"
app:popupTheme="?appbarPopupTheme"
app:theme="?toolbarTheme"
app:title="@string/module_activity_trampoline_app_name"
app:titleTextAppearance="@style/TextAppearance.AppCompat.Subhead"
app:titleTextColor="?menuIconTint"
tools:title="Title very long very very long!!!!">

</androidx.appcompat.widget.Toolbar>
</androidx.appcompat.widget.Toolbar>
</com.google.android.material.appbar.CollapsingToolbarLayout>
</com.google.android.material.appbar.AppBarLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/appbar"
android:orientation="vertical">
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?cardsBackgroundColor"
android:orientation="vertical"
app:layout_behavior="@string/appbar_scrolling_view_behavior">

<github.tornaco.android.thanos.widget.SwitchBar
android:id="@+id/switch_bar"
android:layout_width="match_parent"
android:layout_height="?actionBarSize"
android:foreground="?selectableItemBackground"
android:theme="?switchBarTheme"
tools:ignore="UnusedAttribute" />
<include
android:id="@+id/switch_bar_container"
layout="@layout/module_common_switchbar_container" />

<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/swipe"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:refreshing="@{viewModel.isDataLoading}">
android:id="@+id/swipe"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:refreshing="@{viewModel.isDataLoading}">

<com.simplecityapps.recyclerview_fastscroll.views.FastScrollRecyclerView
android:id="@+id/replacements"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?cardsBackgroundColor"
android:replacements="@{viewModel.replacements}" />
android:id="@+id/replacements"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?cardsBackgroundColor"
android:replacements="@{viewModel.replacements}" />

</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
</LinearLayout>

<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_margin="@dimen/common_view_margin_default"
android:tint="@color/md_white"
app:backgroundTint="@color/md_green_a700"
app:icon="@drawable/module_activity_trampoline_ic_add_fill"
app:iconTint="@color/md_white" />
</RelativeLayout>
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|bottom"
android:layout_margin="@dimen/common_view_margin_default"
android:tint="@color/md_white"
app:backgroundTint="@color/md_green_a700"
app:icon="@drawable/module_activity_trampoline_ic_add_fill"
app:iconTint="@color/md_white" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>
</layout>
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="6dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="6dp"
android:layout_marginBottom="10dp"
app:cardCornerRadius="24dp"
app:cardElevation="@dimen/common_toolbar_elevation">

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ private void setupView() {
binding.swipe.setOnRefreshListener(() -> viewModel.start());
binding.swipe.setColorSchemeColors(getResources().getIntArray(github.tornaco.android.thanos.module.common.R.array.common_swipe_refresh_colors));

onSetupSwitchBar(binding.switchBar);
onSetupSwitchBar(binding.switchBarContainer.switchBar);

// Search.
binding.searchView.setOnQueryTextListener(
Expand All @@ -90,12 +90,14 @@ public boolean onQueryTextChange(String newText) {
new MaterialSearchView.SearchViewListener() {
@Override
public void onSearchViewShown() {
// Noop.
binding.toolbarLayout.setTitleEnabled(false);
binding.appbar.setExpanded(false, true);
}

@Override
public void onSearchViewClosed() {
viewModel.clearSearchText();
binding.toolbarLayout.setTitleEnabled(true);
}
});
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,87 +1,99 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">

<data>

<import type="android.view.View" />

<variable
name="viewModel"
type="github.tornaco.android.thanox.module.notification.recorder.NRDListViewModel" />
name="viewModel"
type="github.tornaco.android.thanox.module.notification.recorder.NRDListViewModel" />

</data>


<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent">

<com.google.android.material.appbar.AppBarLayout app:elevation="@dimen/common_toolbar_elevation"
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:background="?colorPrimary"
android:theme="?appbarTheme">

<FrameLayout
android:id="@+id/toolbar_container"
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="@dimen/common_coll_appbar_height"
android:layout_alignParentTop="true"
android:background="?colorPrimary"
android:theme="?appbarTheme"
app:elevation="@dimen/common_toolbar_elevation">

<com.google.android.material.appbar.CollapsingToolbarLayout
android:id="@+id/toolbar_layout"
style="@style/Widget.MaterialComponents.Toolbar.Primary"
android:layout_width="match_parent"
android:layout_height="wrap_content">

<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
app:collapsedTitleTextAppearance="@style/ToolbarCollapsedTitleTextAppearance"
app:contentScrim="?attr/colorPrimary"
app:expandedTitleTextAppearance="@style/ToolbarExpandedTitleTextAppearance"
app:layout_scrollFlags="scroll|exitUntilCollapsed"
app:titleCollapseMode="scale"
app:toolbarId="@+id/toolbar">

<FrameLayout
android:id="@+id/toolbar_container"
android:layout_width="match_parent"
android:layout_height="?actionBarSize"
app:popupTheme="?appbarPopupTheme"
app:theme="?toolbarTheme"
app:titleTextAppearance="@style/TextAppearance.AppCompat.Subhead"
app:titleTextColor="?menuIconTint"
tools:title="Title very long very very long!!!!">
android:layout_height="wrap_content"
app:layout_collapseMode="pin">

</androidx.appcompat.widget.Toolbar>
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?actionBarSize"
app:popupTheme="?appbarPopupTheme"
app:theme="?toolbarTheme"
app:titleTextAppearance="@style/TextAppearance.AppCompat.Subhead"
app:titleTextColor="?menuIconTint"
tools:title="Title very long very very long!!!!">

<com.miguelcatalan.materialsearchview.MaterialSearchView
android:id="@+id/search_view"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</FrameLayout>
</androidx.appcompat.widget.Toolbar>

<com.miguelcatalan.materialsearchview.MaterialSearchView
android:id="@+id/search_view"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</FrameLayout>
</com.google.android.material.appbar.CollapsingToolbarLayout>
</com.google.android.material.appbar.AppBarLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/appbar"
android:orientation="vertical">
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?cardsBackgroundColor"
android:orientation="vertical"
app:layout_behavior="@string/appbar_scrolling_view_behavior">

<github.tornaco.android.thanos.widget.SwitchBar
android:id="@+id/switch_bar"
android:layout_width="match_parent"
android:layout_height="?actionBarSize"
android:foreground="?selectableItemBackground"
android:theme="?switchBarTheme"
tools:ignore="UnusedAttribute" />
<include
android:id="@+id/switch_bar_container"
layout="@layout/module_common_switchbar_container" />

<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/swipe"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:refreshing="@{viewModel.isDataLoading}">
android:id="@+id/swipe"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:refreshing="@{viewModel.isDataLoading}">

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/apps"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="@dimen/dashboard_card_start_margin"
android:layout_marginTop="@dimen/dashboard_card_top_margin"
android:layout_marginEnd="@dimen/dashboard_card_start_margin"
android:notificationRecordModels="@{viewModel.recordModelGroups}"
app:fastScrollEnabled="false" />
android:id="@+id/apps"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="@dimen/dashboard_card_start_margin"
android:layout_marginTop="@dimen/dashboard_card_top_margin"
android:layout_marginEnd="@dimen/dashboard_card_start_margin"
android:notificationRecordModels="@{viewModel.recordModelGroups}"
app:fastScrollEnabled="false" />

</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
</LinearLayout>
</RelativeLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
</layout>
Loading

0 comments on commit 2e50dcf

Please sign in to comment.