mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-24 04:58:45 +00:00
Show an error animation if you don't select a help category.
This commit is contained in:
@@ -6,6 +6,7 @@ import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.animation.AnimationUtils;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.CheckBox;
|
||||
@@ -110,7 +111,13 @@ public class HelpFragment extends LoggingFragment {
|
||||
faq.setOnClickListener(v -> launchFaq());
|
||||
debugLogInfo.setOnClickListener(v -> launchDebugLogInfo());
|
||||
next.setOnClickListener(v -> submitForm());
|
||||
toaster.setOnClickListener(v -> Toast.makeText(requireContext(), R.string.HelpFragment__please_be_as_descriptive_as_possible, Toast.LENGTH_LONG).show());
|
||||
toaster.setOnClickListener(v -> {
|
||||
if (helpViewModel.getCategoryIndex() == 0) {
|
||||
categorySpinner.startAnimation(AnimationUtils.loadAnimation(requireContext(), R.anim.shake_horizontal));
|
||||
}
|
||||
|
||||
Toast.makeText(requireContext(), R.string.HelpFragment__please_be_as_descriptive_as_possible, Toast.LENGTH_LONG).show();
|
||||
});
|
||||
categorySpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
@Override
|
||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||
|
||||
8
app/src/main/res/anim/shake_horizontal.xml
Normal file
8
app/src/main/res/anim/shake_horizontal.xml
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<set xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<translate android:duration="50"
|
||||
android:fromXDelta="-2%"
|
||||
android:repeatCount="5"
|
||||
android:repeatMode="reverse"
|
||||
android:toXDelta="2%"/>
|
||||
</set>
|
||||
Reference in New Issue
Block a user