mirror of https://github.com/M66B/FairEmail.git
Added fetch more / sync to navigation actions
This commit is contained in:
parent
d3c6730808
commit
f86ea538ba
|
@ -108,6 +108,8 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
|
||||||
private ImageButton ibExpanderNav;
|
private ImageButton ibExpanderNav;
|
||||||
private ImageButton ibPin;
|
private ImageButton ibPin;
|
||||||
private ImageButton ibSettings;
|
private ImageButton ibSettings;
|
||||||
|
private ImageButton ibFetchMore;
|
||||||
|
private ImageButton ibSync;
|
||||||
private View vSeparatorOptions;
|
private View vSeparatorOptions;
|
||||||
private ImageButton ibExpanderAccount;
|
private ImageButton ibExpanderAccount;
|
||||||
private RecyclerView rvAccount;
|
private RecyclerView rvAccount;
|
||||||
|
@ -277,6 +279,8 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
|
||||||
ibExpanderNav = drawerContainer.findViewById(R.id.ibExpanderNav);
|
ibExpanderNav = drawerContainer.findViewById(R.id.ibExpanderNav);
|
||||||
ibPin = drawerContainer.findViewById(R.id.ibPin);
|
ibPin = drawerContainer.findViewById(R.id.ibPin);
|
||||||
ibSettings = drawerContainer.findViewById(R.id.ibSettings);
|
ibSettings = drawerContainer.findViewById(R.id.ibSettings);
|
||||||
|
ibFetchMore = drawerContainer.findViewById(R.id.ibFetchMore);
|
||||||
|
ibSync = drawerContainer.findViewById(R.id.ibSync);
|
||||||
vSeparatorOptions = drawerContainer.findViewById(R.id.vSeparatorOptions);
|
vSeparatorOptions = drawerContainer.findViewById(R.id.vSeparatorOptions);
|
||||||
grpOptions = drawerContainer.findViewById(R.id.grpOptions);
|
grpOptions = drawerContainer.findViewById(R.id.grpOptions);
|
||||||
ibExpanderAccount = drawerContainer.findViewById(R.id.ibExpanderAccount);
|
ibExpanderAccount = drawerContainer.findViewById(R.id.ibExpanderAccount);
|
||||||
|
@ -346,6 +350,7 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
|
||||||
});
|
});
|
||||||
ibPin.setImageLevel(nav_pinned ? 1 : 0);
|
ibPin.setImageLevel(nav_pinned ? 1 : 0);
|
||||||
|
|
||||||
|
// Navigation settings
|
||||||
ibSettings.setOnClickListener(new View.OnClickListener() {
|
ibSettings.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
|
@ -385,6 +390,25 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
ibFetchMore.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
Bundle args = new Bundle();
|
||||||
|
args.putLong("folder", -1L); // Unified inbox
|
||||||
|
|
||||||
|
FragmentDialogSync sync = new FragmentDialogSync();
|
||||||
|
sync.setArguments(args);
|
||||||
|
sync.show(getSupportFragmentManager(), "nav:fetch");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
ibSync.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
ServiceSynchronize.reload(ActivityView.this, null, true, "nav:sync");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
ibExpanderNav.setVisibility(nav_options ? View.VISIBLE : View.GONE);
|
ibExpanderNav.setVisibility(nav_options ? View.VISIBLE : View.GONE);
|
||||||
grpOptions.setVisibility(nav_expanded && nav_options ? View.VISIBLE : View.GONE);
|
grpOptions.setVisibility(nav_expanded && nav_options ? View.VISIBLE : View.GONE);
|
||||||
vSeparatorOptions.setVisibility(nav_options ? View.VISIBLE : View.GONE);
|
vSeparatorOptions.setVisibility(nav_options ? View.VISIBLE : View.GONE);
|
||||||
|
|
|
@ -50,13 +50,33 @@
|
||||||
app:layout_constraintTop_toBottomOf="@id/tvTitle"
|
app:layout_constraintTop_toBottomOf="@id/tvTitle"
|
||||||
app:srcCompat="@drawable/twotone_settings_24" />
|
app:srcCompat="@drawable/twotone_settings_24" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/ivFetchMore"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="12dp"
|
||||||
|
android:padding="6dp"
|
||||||
|
app:layout_constraintStart_toEndOf="@id/ivSettings"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/tvTitle"
|
||||||
|
app:srcCompat="@drawable/twotone_get_app_24" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/ivSync"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="12dp"
|
||||||
|
android:padding="6dp"
|
||||||
|
app:layout_constraintStart_toEndOf="@id/ivFetchMore"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/tvTitle"
|
||||||
|
app:srcCompat="@drawable/twotone_sync_24" />
|
||||||
|
|
||||||
<View
|
<View
|
||||||
android:id="@+id/vDash"
|
android:id="@+id/vDash"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="2dp"
|
android:layout_height="2dp"
|
||||||
android:background="?attr/colorWarning"
|
android:background="?attr/colorWarning"
|
||||||
app:layout_constraintBottom_toBottomOf="@id/ivExpanderNav"
|
app:layout_constraintBottom_toBottomOf="@id/ivExpanderNav"
|
||||||
app:layout_constraintEnd_toEndOf="@id/ivSettings"
|
app:layout_constraintEnd_toEndOf="@id/ivSync"
|
||||||
app:layout_constraintStart_toStartOf="@id/ivExpanderNav"
|
app:layout_constraintStart_toStartOf="@id/ivExpanderNav"
|
||||||
app:layout_constraintTop_toTopOf="@id/ivExpanderNav" />
|
app:layout_constraintTop_toTopOf="@id/ivExpanderNav" />
|
||||||
|
|
||||||
|
|
|
@ -41,6 +41,28 @@
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
app:srcCompat="@drawable/twotone_settings_24" />
|
app:srcCompat="@drawable/twotone_settings_24" />
|
||||||
|
|
||||||
|
<ImageButton
|
||||||
|
android:id="@+id/ibFetchMore"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||||
|
android:contentDescription="@string/title_setup"
|
||||||
|
android:padding="6dp"
|
||||||
|
app:layout_constraintStart_toEndOf="@id/ibSettings"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:srcCompat="@drawable/twotone_get_app_24" />
|
||||||
|
|
||||||
|
<ImageButton
|
||||||
|
android:id="@+id/ibSync"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||||
|
android:contentDescription="@string/title_setup"
|
||||||
|
android:padding="6dp"
|
||||||
|
app:layout_constraintStart_toEndOf="@id/ibFetchMore"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:srcCompat="@drawable/twotone_sync_24" />
|
||||||
|
|
||||||
<View
|
<View
|
||||||
android:id="@+id/vSeparatorOptions"
|
android:id="@+id/vSeparatorOptions"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
|
@ -54,7 +76,7 @@
|
||||||
android:id="@+id/grpOptions"
|
android:id="@+id/grpOptions"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
app:constraint_referenced_ids="ibPin,ibSettings" />
|
app:constraint_referenced_ids="ibPin,ibSettings,ibFetchMore,ibSync" />
|
||||||
|
|
||||||
<ImageButton
|
<ImageButton
|
||||||
android:id="@+id/ibExpanderAccount"
|
android:id="@+id/ibExpanderAccount"
|
||||||
|
|
Loading…
Reference in New Issue