import android.widget.AutoCompleteTextView;
import android.widget.EditText;
import android.widget.FilterQueryProvider;
+import android.widget.ProgressBar;
import android.widget.SimpleCursorAdapter;
import android.widget.TableLayout;
import android.widget.TableRow;
public class NewTransactionActivity extends AppCompatActivity implements TaskCallback {
private TableLayout table;
private FloatingActionButton fab;
+ private ProgressBar progress;
private TextView text_date;
private TextView text_descr;
private static SaveTransactionTask saver;
new_transaction_save_clicked(view);
}
});
+ progress = findViewById(R.id.save_transaction_progress);
+
Objects.requireNonNull(getSupportActionBar()).setDisplayHomeAsUpEnabled(true);
table = findViewById(R.id.new_transaction_accounts_table);
for (int i = 0; i < table.getChildCount(); i++) {
public void new_transaction_save_clicked(View view) {
fab.setEnabled(false);
+ progress.setVisibility(View.VISIBLE);
saver = new SaveTransactionTask(this);
@Override
public void done() {
fab.setEnabled(true);
+ progress.setVisibility(View.INVISIBLE);
reset_form();
}
<include layout="@layout/content_new_transaction" />
- <android.support.design.widget.FloatingActionButton
- android:id="@+id/fab"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="bottom|end"
- android:layout_margin="@dimen/fab_margin"
- android:foregroundTint="@android:color/white"
- android:tint="@android:color/white"
- app:backgroundTint="@color/colorPrimary"
- app:srcCompat="@android:drawable/ic_menu_save" />
+ <android.support.constraint.ConstraintLayout
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ >
+
+ <ProgressBar
+ android:id="@+id/save_transaction_progress"
+ android:layout_width="80dp"
+ android:layout_height="80dp"
+ android:layout_margin="4dp"
+ android:visibility="invisible"
+ app:layout_constraintBottom_toBottomOf="parent"
+ app:layout_constraintEnd_toEndOf="parent" />
+
+ <android.support.design.widget.FloatingActionButton
+ android:id="@+id/fab"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center"
+ android:foregroundTint="@android:color/white"
+ android:padding="@dimen/fab_margin"
+ android:tint="@android:color/white"
+ app:backgroundTint="@color/colorPrimary"
+ app:layout_constraintBottom_toBottomOf="@id/save_transaction_progress"
+ app:layout_constraintEnd_toEndOf="@id/save_transaction_progress"
+ app:layout_constraintStart_toStartOf="@id/save_transaction_progress"
+ app:layout_constraintTop_toTopOf="@id/save_transaction_progress"
+ app:srcCompat="@android:drawable/ic_menu_save" />
+
+ </android.support.constraint.ConstraintLayout>
</android.support.design.widget.CoordinatorLayout>
\ No newline at end of file