mirror of
https://github.com/readrops/Readrops.git
synced 2025-02-02 19:56:50 +01:00
Improve AddFeedActivity UI
This commit is contained in:
parent
e51b9e8a7e
commit
5d28f34a8d
@ -2,27 +2,23 @@ package com.readrops.app.activities;
|
|||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.graphics.Color;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.util.Patterns;
|
import android.util.Patterns;
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.MotionEvent;
|
import android.view.MotionEvent;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.Button;
|
|
||||||
import android.widget.ProgressBar;
|
|
||||||
import android.widget.Spinner;
|
|
||||||
import android.widget.TextView;
|
|
||||||
|
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import androidx.core.widget.NestedScrollView;
|
import androidx.databinding.DataBindingUtil;
|
||||||
import androidx.lifecycle.ViewModelProviders;
|
import androidx.lifecycle.ViewModelProviders;
|
||||||
import androidx.recyclerview.widget.DiffUtil;
|
import androidx.recyclerview.widget.DiffUtil;
|
||||||
import androidx.recyclerview.widget.ItemTouchHelper;
|
import androidx.recyclerview.widget.ItemTouchHelper;
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
import com.google.android.material.textfield.TextInputEditText;
|
|
||||||
import com.mikepenz.fastadapter.FastAdapter;
|
import com.mikepenz.fastadapter.FastAdapter;
|
||||||
import com.mikepenz.fastadapter.adapters.ItemAdapter;
|
import com.mikepenz.fastadapter.adapters.ItemAdapter;
|
||||||
import com.mikepenz.fastadapter.commons.utils.DiffCallback;
|
import com.mikepenz.fastadapter.commons.utils.DiffCallback;
|
||||||
@ -31,6 +27,7 @@ import com.readrops.app.R;
|
|||||||
import com.readrops.app.adapters.AccountArrayAdapter;
|
import com.readrops.app.adapters.AccountArrayAdapter;
|
||||||
import com.readrops.app.database.entities.Feed;
|
import com.readrops.app.database.entities.Feed;
|
||||||
import com.readrops.app.database.entities.account.Account;
|
import com.readrops.app.database.entities.account.Account;
|
||||||
|
import com.readrops.app.databinding.ActivityAddFeedBinding;
|
||||||
import com.readrops.app.utils.FeedInsertionResult;
|
import com.readrops.app.utils.FeedInsertionResult;
|
||||||
import com.readrops.app.utils.ParsingResult;
|
import com.readrops.app.utils.ParsingResult;
|
||||||
import com.readrops.app.utils.ReadropsItemTouchCallback;
|
import com.readrops.app.utils.ReadropsItemTouchCallback;
|
||||||
@ -47,19 +44,6 @@ import io.reactivex.schedulers.Schedulers;
|
|||||||
|
|
||||||
public class AddFeedActivity extends AppCompatActivity implements View.OnClickListener {
|
public class AddFeedActivity extends AppCompatActivity implements View.OnClickListener {
|
||||||
|
|
||||||
private TextInputEditText feedInput;
|
|
||||||
private Button load;
|
|
||||||
private ProgressBar progressBar;
|
|
||||||
private Button validate;
|
|
||||||
private RecyclerView parseResultsRecyclerView;
|
|
||||||
private TextView resultsTextView;
|
|
||||||
|
|
||||||
private NestedScrollView rootLayout;
|
|
||||||
|
|
||||||
private ProgressBar feedInsertionProgressBar;
|
|
||||||
private RecyclerView insertionResultsRecyclerView;
|
|
||||||
|
|
||||||
private Spinner accountSpinner;
|
|
||||||
private AccountArrayAdapter arrayAdapter;
|
private AccountArrayAdapter arrayAdapter;
|
||||||
|
|
||||||
private ItemAdapter<ParsingResult> parseItemsAdapter;
|
private ItemAdapter<ParsingResult> parseItemsAdapter;
|
||||||
@ -69,34 +53,25 @@ public class AddFeedActivity extends AppCompatActivity implements View.OnClickLi
|
|||||||
private AddFeedsViewModel viewModel;
|
private AddFeedsViewModel viewModel;
|
||||||
private ArrayList<Feed> feedsToUpdate;
|
private ArrayList<Feed> feedsToUpdate;
|
||||||
|
|
||||||
|
private ActivityAddFeedBinding binding;
|
||||||
|
|
||||||
@SuppressLint("ClickableViewAccessibility")
|
@SuppressLint("ClickableViewAccessibility")
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_add_feed);
|
binding = DataBindingUtil.setContentView(this, R.layout.activity_add_feed);
|
||||||
|
|
||||||
feedInput = findViewById(R.id.add_feed_text_input);
|
binding.addFeedLoad.setOnClickListener(this);
|
||||||
load = findViewById(R.id.add_feed_load);
|
binding.addFeedOk.setOnClickListener(this);
|
||||||
validate = findViewById(R.id.add_feed_ok);
|
binding.addFeedOk.setEnabled(false);
|
||||||
progressBar = findViewById(R.id.add_feed_loading);
|
|
||||||
parseResultsRecyclerView = findViewById(R.id.add_feed_results);
|
|
||||||
resultsTextView = findViewById(R.id.add_feed_results_text_view);
|
|
||||||
feedInsertionProgressBar = findViewById(R.id.add_feed_insert_progressbar);
|
|
||||||
insertionResultsRecyclerView = findViewById(R.id.add_feed_inserted_results_recyclerview);
|
|
||||||
accountSpinner = findViewById(R.id.add_feed_account_spinner);
|
|
||||||
|
|
||||||
rootLayout = findViewById(R.id.add_feed_root);
|
binding.addFeedTextInput.setOnTouchListener((v, event) -> {
|
||||||
|
|
||||||
load.setOnClickListener(this);
|
|
||||||
validate.setOnClickListener(this);
|
|
||||||
validate.setEnabled(false);
|
|
||||||
|
|
||||||
feedInput.setOnTouchListener((v, event) -> {
|
|
||||||
final int DRAWABLE_RIGHT = 2;
|
final int DRAWABLE_RIGHT = 2;
|
||||||
|
|
||||||
int drawablePos = (feedInput.getRight() - feedInput.getCompoundDrawables()[DRAWABLE_RIGHT].getBounds().width());
|
int drawablePos = (binding.addFeedTextInput.getRight() -
|
||||||
|
binding.addFeedTextInput.getCompoundDrawables()[DRAWABLE_RIGHT].getBounds().width());
|
||||||
if (event.getAction() == MotionEvent.ACTION_UP && event.getRawX() >= drawablePos) {
|
if (event.getAction() == MotionEvent.ACTION_UP && event.getRawX() >= drawablePos) {
|
||||||
feedInput.setText("");
|
binding.addFeedTextInput.setText("");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -117,39 +92,41 @@ public class AddFeedActivity extends AppCompatActivity implements View.OnClickLi
|
|||||||
fastAdapter.notifyAdapterItemChanged(position);
|
fastAdapter.notifyAdapterItemChanged(position);
|
||||||
}
|
}
|
||||||
|
|
||||||
validate.setEnabled(recyclerViewHasCheckedItems());
|
binding.addFeedOk.setEnabled(recyclerViewHasCheckedItems());
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
|
||||||
parseResultsRecyclerView.setAdapter(fastAdapter);
|
binding.addFeedResults.setAdapter(fastAdapter);
|
||||||
RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(this);
|
RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(this);
|
||||||
parseResultsRecyclerView.setLayoutManager(layoutManager);
|
binding.addFeedResults.setLayoutManager(layoutManager);
|
||||||
|
|
||||||
new ItemTouchHelper(new ReadropsItemTouchCallback(this,
|
new ItemTouchHelper(new ReadropsItemTouchCallback(this,
|
||||||
new ReadropsItemTouchCallback.Config.Builder()
|
new ReadropsItemTouchCallback.Config.Builder()
|
||||||
.swipeDirs(ItemTouchHelper.LEFT | ItemTouchHelper.RIGHT)
|
.swipeDirs(ItemTouchHelper.LEFT | ItemTouchHelper.RIGHT)
|
||||||
|
.leftDraw(Color.RED, R.drawable.ic_delete)
|
||||||
|
.rightDraw(Color.RED, R.drawable.ic_delete)
|
||||||
.swipeCallback((viewHolder, direction) -> {
|
.swipeCallback((viewHolder, direction) -> {
|
||||||
parseItemsAdapter.remove(viewHolder.getAdapterPosition());
|
parseItemsAdapter.remove(viewHolder.getAdapterPosition());
|
||||||
|
|
||||||
if (parseItemsAdapter.getAdapterItemCount() == 0) {
|
if (parseItemsAdapter.getAdapterItemCount() == 0) {
|
||||||
resultsTextView.setVisibility(View.GONE);
|
binding.addFeedResultsTextView.setVisibility(View.GONE);
|
||||||
parseResultsRecyclerView.setVisibility(View.GONE);
|
binding.addFeedResults.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.build()))
|
.build()))
|
||||||
.attachToRecyclerView(parseResultsRecyclerView);
|
.attachToRecyclerView(binding.addFeedResults);
|
||||||
|
|
||||||
insertionResultsAdapter = new ItemAdapter<>();
|
insertionResultsAdapter = new ItemAdapter<>();
|
||||||
RecyclerView.LayoutManager layoutManager1 = new LinearLayoutManager(this);
|
RecyclerView.LayoutManager layoutManager1 = new LinearLayoutManager(this);
|
||||||
insertionResultsRecyclerView.setAdapter(FastAdapter.with(insertionResultsAdapter));
|
binding.addFeedInsertedResultsRecyclerview.setAdapter(FastAdapter.with(insertionResultsAdapter));
|
||||||
insertionResultsRecyclerView.setLayoutManager(layoutManager1);
|
binding.addFeedInsertedResultsRecyclerview.setLayoutManager(layoutManager1);
|
||||||
|
|
||||||
viewModel.getAccounts().observe(this, accounts -> {
|
viewModel.getAccounts().observe(this, accounts -> {
|
||||||
arrayAdapter = new AccountArrayAdapter(this, accounts);
|
arrayAdapter = new AccountArrayAdapter(this, accounts);
|
||||||
arrayAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
arrayAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
||||||
|
|
||||||
accountSpinner.setAdapter(arrayAdapter);
|
binding.addFeedAccountSpinner.setAdapter(arrayAdapter);
|
||||||
});
|
});
|
||||||
|
|
||||||
feedsToUpdate = new ArrayList<>();
|
feedsToUpdate = new ArrayList<>();
|
||||||
@ -160,7 +137,7 @@ public class AddFeedActivity extends AppCompatActivity implements View.OnClickLi
|
|||||||
switch (v.getId()) {
|
switch (v.getId()) {
|
||||||
case R.id.add_feed_load:
|
case R.id.add_feed_load:
|
||||||
if (isValidUrl()) {
|
if (isValidUrl()) {
|
||||||
progressBar.setVisibility(View.VISIBLE);
|
binding.addFeedLoading.setVisibility(View.VISIBLE);
|
||||||
loadFeed();
|
loadFeed();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -172,13 +149,13 @@ public class AddFeedActivity extends AppCompatActivity implements View.OnClickLi
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean isValidUrl() {
|
private boolean isValidUrl() {
|
||||||
String url = feedInput.getText().toString().trim();
|
String url = binding.addFeedTextInput.getText().toString().trim();
|
||||||
|
|
||||||
if (url.isEmpty()) {
|
if (url.isEmpty()) {
|
||||||
feedInput.setError(getString(R.string.empty_field));
|
binding.addFeedTextInput.setError(getString(R.string.empty_field));
|
||||||
return false;
|
return false;
|
||||||
} else if (!Patterns.WEB_URL.matcher(url).matches()) {
|
} else if (!Patterns.WEB_URL.matcher(url).matches()) {
|
||||||
feedInput.setError(getString(R.string.wrong_url));
|
binding.addFeedTextInput.setError(getString(R.string.wrong_url));
|
||||||
return false;
|
return false;
|
||||||
} else
|
} else
|
||||||
return true;
|
return true;
|
||||||
@ -203,7 +180,7 @@ public class AddFeedActivity extends AppCompatActivity implements View.OnClickLi
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void loadFeed() {
|
private void loadFeed() {
|
||||||
String url = feedInput.getText().toString().trim();
|
String url = binding.addFeedTextInput.getText().toString().trim();
|
||||||
|
|
||||||
final String finalUrl;
|
final String finalUrl;
|
||||||
if (!(url.contains(Utils.HTTP_PREFIX) || url.contains(Utils.HTTPS_PREFIX)))
|
if (!(url.contains(Utils.HTTP_PREFIX) || url.contains(Utils.HTTPS_PREFIX)))
|
||||||
@ -222,17 +199,18 @@ public class AddFeedActivity extends AppCompatActivity implements View.OnClickLi
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(Throwable e) {
|
public void onError(Throwable e) {
|
||||||
Utils.showSnackbar(rootLayout, e.getMessage());
|
Utils.showSnackbar(binding.addFeedRoot, e.getMessage());
|
||||||
progressBar.setVisibility(View.GONE);
|
binding.addFeedLoading.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void displayParseResults(List<ParsingResult> parsingResultList) {
|
private void displayParseResults(List<ParsingResult> parsingResultList) {
|
||||||
|
binding.addFeedLoading.setVisibility(View.GONE);
|
||||||
|
|
||||||
if (!parsingResultList.isEmpty()) {
|
if (!parsingResultList.isEmpty()) {
|
||||||
parseResultsRecyclerView.setVisibility(View.VISIBLE);
|
binding.addFeedResultsTextView.setVisibility(View.VISIBLE);
|
||||||
progressBar.setVisibility(View.GONE);
|
binding.addFeedResults.setVisibility(View.VISIBLE);
|
||||||
resultsTextView.setVisibility(View.VISIBLE);
|
|
||||||
|
|
||||||
DiffUtil.DiffResult diffResult = FastAdapterDiffUtil.calculateDiff(parseItemsAdapter, parsingResultList, new DiffCallback<ParsingResult>() {
|
DiffUtil.DiffResult diffResult = FastAdapterDiffUtil.calculateDiff(parseItemsAdapter, parsingResultList, new DiffCallback<ParsingResult>() {
|
||||||
@Override
|
@Override
|
||||||
@ -255,14 +233,13 @@ public class AddFeedActivity extends AppCompatActivity implements View.OnClickLi
|
|||||||
}, false);
|
}, false);
|
||||||
|
|
||||||
FastAdapterDiffUtil.set(parseItemsAdapter, diffResult);
|
FastAdapterDiffUtil.set(parseItemsAdapter, diffResult);
|
||||||
validate.setEnabled(recyclerViewHasCheckedItems());
|
binding.addFeedOk.setEnabled(recyclerViewHasCheckedItems());
|
||||||
} else
|
}
|
||||||
progressBar.setVisibility(View.GONE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void insertFeeds() {
|
private void insertFeeds() {
|
||||||
feedInsertionProgressBar.setVisibility(View.VISIBLE);
|
binding.addFeedInsertProgressbar.setVisibility(View.VISIBLE);
|
||||||
validate.setEnabled(false);
|
binding.addFeedOk.setEnabled(false);
|
||||||
|
|
||||||
List<ParsingResult> feedsToInsert = new ArrayList<>();
|
List<ParsingResult> feedsToInsert = new ArrayList<>();
|
||||||
for (ParsingResult result : parseItemsAdapter.getAdapterItems()) {
|
for (ParsingResult result : parseItemsAdapter.getAdapterItems()) {
|
||||||
@ -270,7 +247,7 @@ public class AddFeedActivity extends AppCompatActivity implements View.OnClickLi
|
|||||||
feedsToInsert.add(result);
|
feedsToInsert.add(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
Account account = (Account) accountSpinner.getSelectedItem();
|
Account account = (Account) binding.addFeedAccountSpinner.getSelectedItem();
|
||||||
|
|
||||||
account.setLogin(SharedPreferencesManager.readString(this, account.getLoginKey()));
|
account.setLogin(SharedPreferencesManager.readString(this, account.getLoginKey()));
|
||||||
account.setPassword(SharedPreferencesManager.readString(this, account.getPasswordKey()));
|
account.setPassword(SharedPreferencesManager.readString(this, account.getPasswordKey()));
|
||||||
@ -286,16 +263,16 @@ public class AddFeedActivity extends AppCompatActivity implements View.OnClickLi
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(Throwable e) {
|
public void onError(Throwable e) {
|
||||||
feedInsertionProgressBar.setVisibility(View.GONE);
|
binding.addFeedInsertProgressbar.setVisibility(View.GONE);
|
||||||
validate.setEnabled(true);
|
binding.addFeedOk.setEnabled(true);
|
||||||
Utils.showSnackbar(rootLayout, e.getMessage());
|
Utils.showSnackbar(binding.addFeedRoot, e.getMessage());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void displayInsertionResults(List<FeedInsertionResult> feedInsertionResults) {
|
private void displayInsertionResults(List<FeedInsertionResult> feedInsertionResults) {
|
||||||
feedInsertionProgressBar.setVisibility(View.GONE);
|
binding.addFeedInsertProgressbar.setVisibility(View.GONE);
|
||||||
insertionResultsRecyclerView.setVisibility(View.VISIBLE);
|
binding.addFeedInsertedResultsRecyclerview.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
for (FeedInsertionResult feedInsertionResult : feedInsertionResults) {
|
for (FeedInsertionResult feedInsertionResult : feedInsertionResults) {
|
||||||
if (feedInsertionResult.getFeed() != null)
|
if (feedInsertionResult.getFeed() != null)
|
||||||
@ -305,7 +282,7 @@ public class AddFeedActivity extends AppCompatActivity implements View.OnClickLi
|
|||||||
}
|
}
|
||||||
|
|
||||||
insertionResultsAdapter.add(feedInsertionResults);
|
insertionResultsAdapter.add(feedInsertionResults);
|
||||||
validate.setEnabled(recyclerViewHasCheckedItems());
|
binding.addFeedOk.setEnabled(recyclerViewHasCheckedItems());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -342,7 +319,7 @@ public class AddFeedActivity extends AppCompatActivity implements View.OnClickLi
|
|||||||
public boolean onKeyUp(int keyCode, KeyEvent event) {
|
public boolean onKeyUp(int keyCode, KeyEvent event) {
|
||||||
switch (keyCode) {
|
switch (keyCode) {
|
||||||
case KeyEvent.KEYCODE_ENTER:
|
case KeyEvent.KEYCODE_ENTER:
|
||||||
onClick(load);
|
onClick(binding.addFeedLoad);
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
return super.onKeyUp(keyCode, event);
|
return super.onKeyUp(keyCode, event);
|
||||||
|
@ -1,140 +1,154 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:id="@+id/add_feed_root"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
tools:context=".activities.AddFeedActivity">
|
tools:context=".activities.AddFeedActivity">
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.core.widget.NestedScrollView
|
||||||
|
android:id="@+id/add_feed_root"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent">
|
||||||
android:animateLayoutChanges="true"
|
|
||||||
android:padding="20dp">
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/add_feed_main_layout"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
android:animateLayoutChanges="true"
|
android:animateLayoutChanges="true">
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent">
|
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputLayout
|
<Spinner
|
||||||
android:id="@+id/add_feed_input_layout"
|
android:id="@+id/add_feed_account_spinner"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent">
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
tools:listitem="@layout/account_type_item" />
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputEditText
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/add_feed_text_input"
|
android:id="@+id/add_feed_main_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:animateLayoutChanges="true"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/add_feed_account_spinner"
|
||||||
|
android:padding="16dp">
|
||||||
|
|
||||||
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
|
android:id="@+id/add_feed_input_layout"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintEnd_toStartOf="@id/add_feed_load">
|
||||||
|
|
||||||
|
<com.google.android.material.textfield.TextInputEditText
|
||||||
|
android:id="@+id/add_feed_text_input"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:drawableEnd="@drawable/ic_cancel_grey"
|
||||||
|
android:hint="@string/feed_url"
|
||||||
|
android:inputType="text"/>
|
||||||
|
|
||||||
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/add_feed_load"
|
||||||
|
style="@style/GenericButton"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="4dp"
|
||||||
|
android:layout_marginStart="6dp"
|
||||||
|
android:text="@string/load"
|
||||||
|
app:layout_constraintStart_toEndOf="@id/add_feed_input_layout"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent" />
|
||||||
|
|
||||||
|
<ProgressBar
|
||||||
|
android:id="@+id/add_feed_loading"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="8dp"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:visibility="gone"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/add_feed_input_layout"
|
||||||
|
tools:visibility="gone" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/add_feed_results_text_view"
|
||||||
|
style="@style/TextAppearance.Design.Hint"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="12dp"
|
||||||
|
android:text="@string/results"
|
||||||
|
android:visibility="gone"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/add_feed_loading"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/add_feed_results"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:drawableEnd="@drawable/ic_cancel_grey"
|
android:visibility="gone"
|
||||||
android:hint="@string/feed_url"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
android:inputType="text"/>
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/add_feed_results_text_view"
|
||||||
|
tools:visibility="visible"
|
||||||
|
tools:listitem="@layout/add_feed_item"
|
||||||
|
tools:itemCount="2"/>
|
||||||
|
|
||||||
</com.google.android.material.textfield.TextInputLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
<Button
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/add_feed_load"
|
|
||||||
style="@style/GenericButton"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="8dp"
|
|
||||||
android:text="@string/load"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/add_feed_input_layout" />
|
|
||||||
|
|
||||||
<ProgressBar
|
|
||||||
android:id="@+id/add_feed_loading"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="8dp"
|
|
||||||
android:layout_marginTop="8dp"
|
|
||||||
android:visibility="gone"
|
|
||||||
app:layout_constraintStart_toEndOf="@+id/add_feed_load"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/add_feed_input_layout"
|
|
||||||
tools:visibility="visible" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/add_feed_results_text_view"
|
|
||||||
style="@style/TextAppearance.Design.Hint"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/results"
|
|
||||||
android:visibility="gone"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/add_feed_load"
|
|
||||||
tools:visibility="visible" />
|
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
|
||||||
android:id="@+id/add_feed_results"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
android:visibility="gone"
|
app:layout_constraintTop_toBottomOf="@id/add_feed_main_layout"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
android:paddingStart="16dp"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
android:paddingEnd="16dp">
|
||||||
app:layout_constraintTop_toBottomOf="@+id/add_feed_results_text_view"
|
|
||||||
tools:visibility="visible"
|
<Button
|
||||||
tools:listitem="@layout/add_feed_item"
|
android:id="@+id/add_feed_ok"
|
||||||
tools:itemCount="2"/>
|
style="@style/GenericButton"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:enabled="true"
|
||||||
|
android:text="@string/validate"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintHorizontal_bias="0.6"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<ProgressBar
|
||||||
|
android:id="@+id/add_feed_insert_progressbar"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:visibility="gone"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/add_feed_ok"
|
||||||
|
tools:visibility="gone" />
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/add_feed_inserted_results_recyclerview"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:visibility="gone"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintHorizontal_bias="0.6"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/add_feed_insert_progressbar"
|
||||||
|
tools:visibility="visible"
|
||||||
|
tools:listitem="@layout/feed_insertion_result"
|
||||||
|
tools:itemCount="2"/>
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
<Spinner
|
</androidx.core.widget.NestedScrollView>
|
||||||
android:id="@+id/add_feed_account_spinner"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="8dp"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/add_feed_main_layout"
|
|
||||||
tools:listitem="@layout/account_type_item"/>
|
|
||||||
|
|
||||||
<Button
|
</layout>
|
||||||
android:id="@+id/add_feed_ok"
|
|
||||||
style="@style/GenericButton"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:enabled="true"
|
|
||||||
android:text="@string/validate"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintHorizontal_bias="0.6"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/add_feed_account_spinner" />
|
|
||||||
|
|
||||||
<ProgressBar
|
|
||||||
android:id="@+id/add_feed_insert_progressbar"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="8dp"
|
|
||||||
android:visibility="gone"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/add_feed_ok"
|
|
||||||
tools:visibility="gone" />
|
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
|
||||||
android:id="@+id/add_feed_inserted_results_recyclerview"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="8dp"
|
|
||||||
android:visibility="gone"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintHorizontal_bias="0.6"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/add_feed_insert_progressbar"
|
|
||||||
tools:visibility="visible"
|
|
||||||
tools:listitem="@layout/feed_insertion_result"
|
|
||||||
tools:itemCount="2"/>
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
||||||
|
|
||||||
|
|
||||||
</androidx.core.widget.NestedScrollView>
|
|
Loading…
x
Reference in New Issue
Block a user