mirror of https://codeberg.org/tom79/Fedilab
parent
e425528648
commit
154cc63f69
@ -0,0 +1,85 @@
|
|||||||
|
package app.fedilab.android.activities;
|
||||||
|
/* Copyright 2022 Thomas Schneider
|
||||||
|
*
|
||||||
|
* This file is a part of Fedilab
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify it under the terms of the
|
||||||
|
* GNU General Public License as published by the Free Software Foundation; either version 3 of the
|
||||||
|
* License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* Fedilab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
|
||||||
|
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||||
|
* Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License along with Fedilab; if not,
|
||||||
|
* see <http://www.gnu.org/licenses>. */
|
||||||
|
|
||||||
|
|
||||||
|
import android.graphics.drawable.ColorDrawable;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.os.Handler;
|
||||||
|
import android.os.Looper;
|
||||||
|
import android.view.MenuItem;
|
||||||
|
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
import androidx.core.content.ContextCompat;
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
|
import app.fedilab.android.R;
|
||||||
|
import app.fedilab.android.client.entities.app.Account;
|
||||||
|
import app.fedilab.android.client.entities.app.BaseAccount;
|
||||||
|
import app.fedilab.android.databinding.ActivityCacheBinding;
|
||||||
|
import app.fedilab.android.helper.CacheHelper;
|
||||||
|
import app.fedilab.android.helper.ThemeHelper;
|
||||||
|
import app.fedilab.android.ui.drawer.CacheAdapter;
|
||||||
|
|
||||||
|
public class CacheActivity extends BaseActivity {
|
||||||
|
|
||||||
|
private ActivityCacheBinding binding;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
ThemeHelper.applyThemeBar(this);
|
||||||
|
binding = ActivityCacheBinding.inflate(getLayoutInflater());
|
||||||
|
setContentView(binding.getRoot());
|
||||||
|
if (getSupportActionBar() != null) {
|
||||||
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
|
getSupportActionBar().setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary)));
|
||||||
|
}
|
||||||
|
CacheHelper.getCacheValues(CacheActivity.this, size -> {
|
||||||
|
if (size > 0) {
|
||||||
|
size = size / 1000000.0f;
|
||||||
|
}
|
||||||
|
binding.fileCacheSize.setText(String.format("%s %s", String.format(Locale.getDefault(), "%.2f", size), getString(R.string.cache_units)));
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
new Thread(() -> {
|
||||||
|
List<BaseAccount> accounts = new Account(CacheActivity.this).getPushNotificationAccounts();
|
||||||
|
Handler mainHandler = new Handler(Looper.getMainLooper());
|
||||||
|
Runnable myRunnable = () -> {
|
||||||
|
CacheAdapter cacheAdapter = new CacheAdapter(accounts);
|
||||||
|
LinearLayoutManager mLayoutManager = new LinearLayoutManager(CacheActivity.this);
|
||||||
|
binding.cacheRecyclerview.setLayoutManager(mLayoutManager);
|
||||||
|
binding.cacheRecyclerview.setAdapter(cacheAdapter);
|
||||||
|
};
|
||||||
|
mainHandler.post(myRunnable);
|
||||||
|
}).start();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
|
if (item.getItemId() == android.R.id.home) {
|
||||||
|
finish();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return super.onOptionsItemSelected(item);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,197 @@
|
|||||||
|
package app.fedilab.android.helper;
|
||||||
|
/* Copyright 2022 Thomas Schneider
|
||||||
|
*
|
||||||
|
* This file is a part of Fedilab
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify it under the terms of the
|
||||||
|
* GNU General Public License as published by the Free Software Foundation; either version 3 of the
|
||||||
|
* License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* Fedilab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
|
||||||
|
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||||
|
* Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License along with Fedilab; if not,
|
||||||
|
* see <http://www.gnu.org/licenses>. */
|
||||||
|
|
||||||
|
import static app.fedilab.android.helper.Helper.getCurrentAccount;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.os.Handler;
|
||||||
|
import android.os.Looper;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import androidx.appcompat.app.AlertDialog;
|
||||||
|
import androidx.appcompat.widget.SwitchCompat;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.lang.ref.WeakReference;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
import app.fedilab.android.BaseMainActivity;
|
||||||
|
import app.fedilab.android.R;
|
||||||
|
import app.fedilab.android.client.entities.app.BaseAccount;
|
||||||
|
import app.fedilab.android.client.entities.app.QuickLoad;
|
||||||
|
import app.fedilab.android.client.entities.app.StatusCache;
|
||||||
|
import app.fedilab.android.client.entities.app.StatusDraft;
|
||||||
|
import app.fedilab.android.exception.DBException;
|
||||||
|
import es.dmoral.toasty.Toasty;
|
||||||
|
|
||||||
|
public class CacheHelper {
|
||||||
|
|
||||||
|
public static void getCacheValues(Context context, Callback callback) {
|
||||||
|
new Thread(() -> {
|
||||||
|
long sizeCache = cacheSize(context.getCacheDir().getParentFile());
|
||||||
|
Handler mainHandler = new Handler(Looper.getMainLooper());
|
||||||
|
Runnable myRunnable = () -> callback.getCacheSize(sizeCache);
|
||||||
|
mainHandler.post(myRunnable);
|
||||||
|
}).start();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void getTimelineValues(Context context, BaseAccount account, CallbackAccount callbackAccount) {
|
||||||
|
new Thread(() -> {
|
||||||
|
List<Integer> count = new ArrayList<>();
|
||||||
|
try {
|
||||||
|
count.add(new StatusCache(context).count(account));
|
||||||
|
} catch (DBException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
count.add(new QuickLoad(context).count(account));
|
||||||
|
} catch (DBException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
count.add(new StatusDraft(context).count(account));
|
||||||
|
} catch (DBException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
Handler mainHandler = new Handler(Looper.getMainLooper());
|
||||||
|
Runnable myRunnable = () -> callbackAccount.getcount(count);
|
||||||
|
mainHandler.post(myRunnable);
|
||||||
|
}).start();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves the cache size
|
||||||
|
*
|
||||||
|
* @param directory File
|
||||||
|
* @return long value in Mo
|
||||||
|
*/
|
||||||
|
public static long cacheSize(File directory) {
|
||||||
|
long length = 0;
|
||||||
|
if (directory == null || directory.length() == 0)
|
||||||
|
return -1;
|
||||||
|
for (File file : Objects.requireNonNull(directory.listFiles())) {
|
||||||
|
if (file.isFile()) {
|
||||||
|
try {
|
||||||
|
length += file.length();
|
||||||
|
} catch (NullPointerException e) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (!file.getName().equals("databases") && !file.getName().equals("shared_prefs")) {
|
||||||
|
length += cacheSize(file);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return length;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean deleteDir(File dir) {
|
||||||
|
if (dir != null && dir.isDirectory()) {
|
||||||
|
String[] children = dir.list();
|
||||||
|
assert children != null;
|
||||||
|
for (String aChildren : children) {
|
||||||
|
if (!aChildren.equals("databases") && !aChildren.equals("shared_prefs")) {
|
||||||
|
boolean success = deleteDir(new File(dir, aChildren));
|
||||||
|
if (!success) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return dir.delete();
|
||||||
|
} else {
|
||||||
|
return dir != null && dir.isFile() && dir.delete();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public interface Callback {
|
||||||
|
void getCacheSize(float size);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public interface CallbackAccount {
|
||||||
|
void getcount(List<Integer> countStatuses);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class CacheTask {
|
||||||
|
private final WeakReference<Context> contextReference;
|
||||||
|
private float cacheSize;
|
||||||
|
|
||||||
|
public CacheTask(Context context) {
|
||||||
|
contextReference = new WeakReference<>(context);
|
||||||
|
doInBackground();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void doInBackground() {
|
||||||
|
new Thread(() -> {
|
||||||
|
long sizeCache = cacheSize(contextReference.get().getCacheDir().getParentFile());
|
||||||
|
cacheSize = 0;
|
||||||
|
if (sizeCache > 0) {
|
||||||
|
cacheSize = (float) sizeCache / 1000000.0f;
|
||||||
|
}
|
||||||
|
Handler mainHandler = new Handler(Looper.getMainLooper());
|
||||||
|
Runnable myRunnable = () -> {
|
||||||
|
AlertDialog.Builder builder = new AlertDialog.Builder(contextReference.get(), Helper.dialogStyle());
|
||||||
|
LayoutInflater inflater = ((BaseMainActivity) contextReference.get()).getLayoutInflater();
|
||||||
|
View dialogView = inflater.inflate(R.layout.popup_cache, new LinearLayout(contextReference.get()), false);
|
||||||
|
TextView message = dialogView.findViewById(R.id.message);
|
||||||
|
message.setText(contextReference.get().getString(R.string.cache_message, String.format("%s %s", String.format(Locale.getDefault(), "%.2f", cacheSize), contextReference.get().getString(R.string.cache_units))));
|
||||||
|
builder.setView(dialogView);
|
||||||
|
builder.setTitle(R.string.cache_title);
|
||||||
|
|
||||||
|
final SwitchCompat clean_all = dialogView.findViewById(R.id.clean_all);
|
||||||
|
final float finalCacheSize = cacheSize;
|
||||||
|
builder
|
||||||
|
.setPositiveButton(R.string.clear, (dialog, which) -> new Thread(() -> {
|
||||||
|
try {
|
||||||
|
String path = Objects.requireNonNull(contextReference.get().getCacheDir().getParentFile()).getPath();
|
||||||
|
File dir = new File(path);
|
||||||
|
if (dir.isDirectory()) {
|
||||||
|
deleteDir(dir);
|
||||||
|
}
|
||||||
|
if (clean_all.isChecked()) {
|
||||||
|
new QuickLoad(contextReference.get()).deleteForAllAccount();
|
||||||
|
new StatusCache(contextReference.get()).deleteForAllAccount();
|
||||||
|
} else {
|
||||||
|
new QuickLoad(contextReference.get()).deleteForAccount(getCurrentAccount(contextReference.get()));
|
||||||
|
new StatusCache(contextReference.get()).deleteForAccount(getCurrentAccount(contextReference.get()));
|
||||||
|
}
|
||||||
|
Handler mainHandler2 = new Handler(Looper.getMainLooper());
|
||||||
|
Runnable myRunnable2 = () -> {
|
||||||
|
Toasty.success(contextReference.get(), contextReference.get().getString(R.string.toast_cache_clear, String.format("%s %s", String.format(Locale.getDefault(), "%.2f", finalCacheSize), contextReference.get().getString(R.string.cache_units))), Toast.LENGTH_LONG).show();
|
||||||
|
dialog.dismiss();
|
||||||
|
};
|
||||||
|
mainHandler2.post(myRunnable2);
|
||||||
|
} catch (Exception ignored) {
|
||||||
|
}
|
||||||
|
}).start())
|
||||||
|
.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss())
|
||||||
|
.setIcon(android.R.drawable.ic_dialog_alert)
|
||||||
|
.show();
|
||||||
|
};
|
||||||
|
mainHandler.post(myRunnable);
|
||||||
|
}).start();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,96 @@
|
|||||||
|
package app.fedilab.android.ui.drawer;
|
||||||
|
/* Copyright 2022 Thomas Schneider
|
||||||
|
*
|
||||||
|
* This file is a part of Fedilab
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify it under the terms of the
|
||||||
|
* GNU General Public License as published by the Free Software Foundation; either version 3 of the
|
||||||
|
* License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* Fedilab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
|
||||||
|
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||||
|
* Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License along with Fedilab; if not,
|
||||||
|
* see <http://www.gnu.org/licenses>. */
|
||||||
|
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import app.fedilab.android.activities.ProfileActivity;
|
||||||
|
import app.fedilab.android.client.entities.app.BaseAccount;
|
||||||
|
import app.fedilab.android.databinding.DrawerCacheBinding;
|
||||||
|
import app.fedilab.android.helper.CacheHelper;
|
||||||
|
import app.fedilab.android.helper.MastodonHelper;
|
||||||
|
|
||||||
|
|
||||||
|
public class CacheAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
|
||||||
|
|
||||||
|
private static ProfileActivity.action doAction;
|
||||||
|
private final List<BaseAccount> accountList;
|
||||||
|
private Context context;
|
||||||
|
|
||||||
|
public CacheAdapter(List<BaseAccount> accountList) {
|
||||||
|
this.accountList = accountList;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public int getCount() {
|
||||||
|
return accountList.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
public BaseAccount getItem(int position) {
|
||||||
|
return accountList.get(position);
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||||
|
this.context = parent.getContext();
|
||||||
|
DrawerCacheBinding itemBinding = DrawerCacheBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false);
|
||||||
|
return new AccountCacheViewHolder(itemBinding);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder viewHolder, int position) {
|
||||||
|
BaseAccount account = accountList.get(position);
|
||||||
|
AccountCacheViewHolder holder = (AccountCacheViewHolder) viewHolder;
|
||||||
|
MastodonHelper.loadPPMastodon(holder.binding.pp, account.mastodon_account);
|
||||||
|
holder.binding.acct.setText(String.format("@%s@%s", account.mastodon_account.username, account.instance));
|
||||||
|
holder.binding.displayName.setText(account.mastodon_account.display_name);
|
||||||
|
CacheHelper.getTimelineValues(context, account, countStatuses -> {
|
||||||
|
if (countStatuses != null && countStatuses.size() == 3) {
|
||||||
|
holder.binding.homeCount.setText(String.valueOf(countStatuses.get(0)));
|
||||||
|
holder.binding.otherCount.setText(String.valueOf(countStatuses.get(1)));
|
||||||
|
holder.binding.draftCount.setText(String.valueOf(countStatuses.get(2)));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getItemId(int position) {
|
||||||
|
return position;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemCount() {
|
||||||
|
return accountList.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static class AccountCacheViewHolder extends RecyclerView.ViewHolder {
|
||||||
|
DrawerCacheBinding binding;
|
||||||
|
|
||||||
|
AccountCacheViewHolder(DrawerCacheBinding itemView) {
|
||||||
|
super(itemView.getRoot());
|
||||||
|
binding = itemView;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,40 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout 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"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_margin="@dimen/fab_margin">
|
||||||
|
|
||||||
|
<com.google.android.material.checkbox.MaterialCheckBox
|
||||||
|
android:id="@+id/label_file_cache"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:checked="true"
|
||||||
|
android:text="@string/files_cache_size"
|
||||||
|
app:buttonTint="@color/cyanea_accent_dark_reference"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:id="@+id/file_cache_size"
|
||||||
|
android:layout_width="100dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:textSize="18sp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@+id/label_file_cache"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="@+id/label_file_cache"
|
||||||
|
tools:text="105 Mb" />
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/cache_recyclerview"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/label_file_cache" />
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -0,0 +1,108 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout 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"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
|
android:id="@+id/pp"
|
||||||
|
android:layout_width="50dp"
|
||||||
|
android:layout_height="50dp"
|
||||||
|
android:scaleType="centerCrop"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
tools:src="@tools:sample/avatars" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:id="@+id/display_name"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="10dp"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:textSize="18sp"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/pp"
|
||||||
|
app:layout_constraintTop_toTopOf="@+id/pp"
|
||||||
|
tools:text="@tools:sample/full_names" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:id="@+id/acct"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="10dp"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:textSize="16sp"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/pp"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/display_name"
|
||||||
|
tools:text="@tools:sample/last_names" />
|
||||||
|
|
||||||
|
<com.google.android.material.checkbox.MaterialCheckBox
|
||||||
|
android:id="@+id/label_home_timeline_cache_count"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:checked="true"
|
||||||
|
android:text="@string/messages_in_cache_for_home"
|
||||||
|
app:buttonTint="@color/cyanea_accent_dark_reference"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/pp" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:id="@+id/home_count"
|
||||||
|
android:layout_width="50dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:textSize="18sp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@+id/label_home_timeline_cache_count"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="@+id/label_home_timeline_cache_count"
|
||||||
|
tools:text="50" />
|
||||||
|
|
||||||
|
<com.google.android.material.checkbox.MaterialCheckBox
|
||||||
|
android:id="@+id/label_timelines_cache_count"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:checked="true"
|
||||||
|
android:text="@string/messages_in_cache_for_other_timelines"
|
||||||
|
app:buttonTint="@color/cyanea_accent_dark_reference"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/label_home_timeline_cache_count" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:id="@+id/other_count"
|
||||||
|
android:layout_width="50dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:textSize="18sp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@+id/label_timelines_cache_count"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="@+id/label_timelines_cache_count"
|
||||||
|
tools:text="150" />
|
||||||
|
|
||||||
|
<com.google.android.material.checkbox.MaterialCheckBox
|
||||||
|
android:id="@+id/label_drafts_count"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:checked="false"
|
||||||
|
android:text="@string/messages_stored_in_drafts"
|
||||||
|
app:buttonTint="@color/cyanea_accent_dark_reference"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/label_timelines_cache_count" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:id="@+id/draft_count"
|
||||||
|
android:layout_width="50dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:textSize="18sp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@+id/label_drafts_count"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="@+id/label_drafts_count"
|
||||||
|
tools:text="49" />
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
Loading…
Reference in new issue