本文整理汇总了Java中io.saeid.fabloading.LoadingView类的典型用法代码示例。如果您正苦于以下问题:Java LoadingView类的具体用法?Java LoadingView怎么用?Java LoadingView使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
LoadingView类属于io.saeid.fabloading包,在下文中一共展示了LoadingView类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreateView
import io.saeid.fabloading.LoadingView; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_main, container, false);
gridview = (GridView) rootView.findViewById(R.id.gridview);
gridview.setNumColumns(5);
counter = 0;
dialog = new Dialog(getContext(), android.R.style.Animation_Dialog);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
boolean isLollipop = Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP;
int marvel_1 = isLollipop ? R.drawable.marvel_1_lollipop : R.drawable.marvel_1;
int marvel_2 = isLollipop ? R.drawable.marvel_2_lollipop : R.drawable.marvel_2;
int marvel_3 = isLollipop ? R.drawable.marvel_3_lollipop : R.drawable.marvel_3;
int marvel_4 = isLollipop ? R.drawable.marvel_4_lollipop : R.drawable.marvel_4;
dialog.setContentView(R.layout.loading);
mLoadingView = (LoadingView) rootView.findViewById(R.id.loading_view);
mLoadingView.addAnimation(Color.parseColor("#FFD200"), marvel_1,
LoadingView.FROM_LEFT);
mLoadingView.addAnimation(Color.parseColor("#2F5DA9"), marvel_2,
LoadingView.FROM_TOP);
mLoadingView.addAnimation(Color.parseColor("#FF4218"), marvel_3,
LoadingView.FROM_RIGHT);
mLoadingView.addAnimation(Color.parseColor("#C7E7FB"), marvel_4,
LoadingView.FROM_BOTTOM);
dialog.setCancelable(false);
Window window = getActivity().getWindow();
// clear FLAG_TRANSLUCENT_STATUS flag:
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
// add FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS flag to the window
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
// finally change the coandroid.os.Build.ndroid.os.Build.VERandroid.os.Build.ndroid.os.Build.VERSION_CODES.LOLLIPOP) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
window.setStatusBarColor(getActivity().getResources().getColor(R.color.colorPrimaryDark));
}
gridview.setBackgroundColor(getResources().getColor(R.color.colorAccent));
mRequestingLocationUpdates = false;
mLastUpdateTime = "";
// Update values using data stored in the Bundle.
updateValuesFromBundle(savedInstanceState);
// Kick off the process of building the GoogleApiClient, LocationRequest, and
// LocationSettingsRequest objects.
if (getArguments() != null) {
mParam1 = getArguments().getString(ARG_PARAM1);
mParam2 = getArguments().getString(ARG_PARAM2);
}
metrics = MyApplication.getInstance().getMetrics();
urls = new String[40];
latis = new double[40];
longis = new double[40];
bitmap = new Bitmap[40];
titles = new String[40];
// Inflate the layout for this fragment
buildGoogleApiClient();
createLocationRequest();
buildLocationSettingsRequest();
return rootView;
}