mirror of
https://github.com/ClaytonWWilson/Listify.git
synced 2025-12-16 10:48:46 +00:00
Move loading circle into its own object
This commit is contained in:
parent
e21913882c
commit
6b30476ccd
@ -76,16 +76,7 @@ public class ItemDetails extends AppCompatActivity implements ListPickerDialogFr
|
|||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
closeFABMenu();
|
closeFABMenu();
|
||||||
// Create and show a loading dialog
|
LoadingCircleDialog loadingDialog = new LoadingCircleDialog(ItemDetails.this);
|
||||||
Dialog loadingDialog = new Dialog(ItemDetails.this);
|
|
||||||
loadingDialog.getWindow().requestFeature(Window.FEATURE_NO_TITLE);
|
|
||||||
loadingDialog.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
|
|
||||||
// layout to display
|
|
||||||
loadingDialog.setContentView(R.layout.dialog_loading);
|
|
||||||
// set color transpartent
|
|
||||||
loadingDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
|
||||||
loadingDialog.setCancelable(false);
|
|
||||||
loadingDialog.setCanceledOnTouchOutside(false);
|
|
||||||
loadingDialog.show();
|
loadingDialog.show();
|
||||||
|
|
||||||
Properties configs = new Properties();
|
Properties configs = new Properties();
|
||||||
@ -180,7 +171,7 @@ public class ItemDetails extends AppCompatActivity implements ListPickerDialogFr
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Add the viewed item to the selected list
|
// Add the selected item to the selected list
|
||||||
@Override
|
@Override
|
||||||
public void sendListSelection(int selectedListIndex, int quantity) {
|
public void sendListSelection(int selectedListIndex, int quantity) {
|
||||||
|
|
||||||
@ -207,16 +198,7 @@ public class ItemDetails extends AppCompatActivity implements ListPickerDialogFr
|
|||||||
// Create a new list and add the item to it
|
// Create a new list and add the item to it
|
||||||
@Override
|
@Override
|
||||||
public void sendNewListName(String name, int quantity) {
|
public void sendNewListName(String name, int quantity) {
|
||||||
// Create and show a loading dialog
|
LoadingCircleDialog loadingDialog = new LoadingCircleDialog(this);
|
||||||
Dialog loadingDialog = new Dialog(this);
|
|
||||||
loadingDialog.getWindow().requestFeature(Window.FEATURE_NO_TITLE);
|
|
||||||
loadingDialog.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
|
|
||||||
// layout to display
|
|
||||||
loadingDialog.setContentView(R.layout.dialog_loading);
|
|
||||||
// set color transpartent
|
|
||||||
loadingDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
|
||||||
loadingDialog.setCancelable(false);
|
|
||||||
loadingDialog.setCanceledOnTouchOutside(false);
|
|
||||||
loadingDialog.show();
|
loadingDialog.show();
|
||||||
|
|
||||||
Properties configs = new Properties();
|
Properties configs = new Properties();
|
||||||
|
|||||||
@ -0,0 +1,36 @@
|
|||||||
|
package com.example.listify;
|
||||||
|
|
||||||
|
import android.app.Dialog;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.graphics.Color;
|
||||||
|
import android.graphics.drawable.ColorDrawable;
|
||||||
|
import android.view.Window;
|
||||||
|
import android.view.WindowManager;
|
||||||
|
|
||||||
|
public class LoadingCircleDialog {
|
||||||
|
Dialog loadingDialog;
|
||||||
|
|
||||||
|
public LoadingCircleDialog(Context context) {
|
||||||
|
loadingDialog = new Dialog(context);
|
||||||
|
|
||||||
|
// Create and show a loading dialog
|
||||||
|
loadingDialog.getWindow().requestFeature(Window.FEATURE_NO_TITLE);
|
||||||
|
loadingDialog.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
|
||||||
|
|
||||||
|
// layout to display
|
||||||
|
loadingDialog.setContentView(R.layout.dialog_loading);
|
||||||
|
|
||||||
|
// set color transpartent
|
||||||
|
loadingDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||||
|
loadingDialog.setCancelable(false);
|
||||||
|
loadingDialog.setCanceledOnTouchOutside(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void show() {
|
||||||
|
loadingDialog.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void cancel() {
|
||||||
|
loadingDialog.cancel();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -24,6 +24,7 @@ import com.example.listify.CreateListAddDialogFragment;
|
|||||||
import com.example.listify.CreateListDialogFragment;
|
import com.example.listify.CreateListDialogFragment;
|
||||||
import com.example.listify.ItemDetails;
|
import com.example.listify.ItemDetails;
|
||||||
import com.example.listify.ListPage;
|
import com.example.listify.ListPage;
|
||||||
|
import com.example.listify.LoadingCircleDialog;
|
||||||
import com.example.listify.R;
|
import com.example.listify.R;
|
||||||
import com.example.listify.Requestor;
|
import com.example.listify.Requestor;
|
||||||
import com.example.listify.SearchResults;
|
import com.example.listify.SearchResults;
|
||||||
@ -90,16 +91,7 @@ public class ListsFragment extends Fragment implements CreateListDialogFragment.
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void sendNewListName(String name) {
|
public void sendNewListName(String name) {
|
||||||
// Create and show a loading dialog
|
LoadingCircleDialog loadingDialog = new LoadingCircleDialog(getActivity());
|
||||||
Dialog loadingDialog = new Dialog(getActivity());
|
|
||||||
loadingDialog.getWindow().requestFeature(Window.FEATURE_NO_TITLE);
|
|
||||||
loadingDialog.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
|
|
||||||
// layout to display
|
|
||||||
loadingDialog.setContentView(R.layout.dialog_loading);
|
|
||||||
// set color transpartent
|
|
||||||
loadingDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
|
||||||
loadingDialog.setCancelable(false);
|
|
||||||
loadingDialog.setCanceledOnTouchOutside(false);
|
|
||||||
loadingDialog.show();
|
loadingDialog.show();
|
||||||
|
|
||||||
Properties configs = new Properties();
|
Properties configs = new Properties();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user