Ion shutter and spinner

Is there a way to configure the spinner in the splash screen? I am currently using the splashscreen cordova plugin and I want to change the color of the counter that appears on the splash screen.

+3
source share
2 answers

In platforms/android/src/org/apache/cordova/splashscreen/SplashScreen.java at the top:

 import android.graphics.drawable.Drawable; import android.content.res.Resources; 

And then below, replace this function:

  // Show only spinner in the center of the screen private void spinnerStart() { cordova.getActivity().runOnUiThread(new Runnable() { public void run() { spinnerStop(); spinnerDialog = new ProgressDialog(webView.getContext()); spinnerDialog.setOnCancelListener(new DialogInterface.OnCancelListener() { public void onCancel(DialogInterface dialog) { spinnerDialog = null; } }); spinnerDialog.setCancelable(false); spinnerDialog.setIndeterminate(true); Resources activityRes = cordova.getActivity().getResources(); int spinnerResId = activityRes.getIdentifier("customspinner", "drawable", cordova.getActivity().getPackageName()); Drawable customSpinner = activityRes.getDrawable(spinnerResId); RelativeLayout centeredLayout = new RelativeLayout(cordova.getActivity()); centeredLayout.setGravity(Gravity.CENTER); centeredLayout.setLayoutParams(new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT)); ProgressBar progressBar = new ProgressBar(webView.getContext()); progressBar.setIndeterminateDrawable(customSpinner); RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); layoutParams.addRule(RelativeLayout.CENTER_IN_PARENT, RelativeLayout.TRUE); progressBar.setLayoutParams(layoutParams); centeredLayout.addView(progressBar); spinnerDialog.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND); spinnerDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT)); spinnerDialog.show(); spinnerDialog.setContentView(centeredLayout); } }); } 

In platforms/android/res/drawable - add a folder, if it does not exist - add a customspinner.xml file:

 <?xml version="1.0" encoding="utf-8"?> <rotate xmlns:android="http://schemas.android.com/apk/res/android" android:pivotX="50%" android:pivotY="50%" android:fromDegrees="0" android:toDegrees="360"> <shape android:shape="ring" android:innerRadiusRatio="3" android:thicknessRatio="8" android:useLevel="false"> <size android:width="76dip" android:height="76dip" /> <gradient android:type="sweep" android:useLevel="false" android:startColor="#FFFFFFFF" android:endColor="#00FFFFFF" android:angle="0" /> </shape> </rotate> 

The original answer is here: Screen color with screen extension with Cordoba gap on android

+3
source

Well, providing an ion-spinner color is not difficult. You can do it like this: CSS

 .spinner svg { width: 28px; height: 28px; stroke: #444; fill: #444; } 

HTML

 <ion-spinner icon="circles "class="spinner-energized"></ion-spinner> 

according to the Ionic Docs .

0
source

All Articles