Skip to content

Instantly share code, notes, and snippets.

Avatar
😊

Rasoul Miri rasoulmiri

😊
View GitHub Profile
View timer2
//after 7 second photo load in imageView
//timer for show phoyo
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
header.setImageResource(R.drawable.header_watches);
progressBar.setVisibility(View.GONE);
}
}, 7000);
View timer
//after 7 second photo load in imageView
//timer for show phoyo
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
header.setImageResource(R.drawable.header_watches);
}
}, 7000);
@rasoulmiri
rasoulmiri / style.xml (Flavor finalByWindowBackgroundColor)
Last active Sep 18, 2017
style.xml (Flavor finalByWindowBackgroundColor)
View style.xml (Flavor finalByWindowBackgroundColor)
<resources>
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="android:windowBackground">@color/gray</item>
//...
</style>
</resources>
@rasoulmiri
rasoulmiri / style.xml (Flavor finalByWindowBackgroundNull)
Last active Sep 18, 2017
style.xml (Flavor finalByWindowBackgroundNull)
View style.xml (Flavor finalByWindowBackgroundNull)
<resources>
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="android:windowBackground">@null</item>
//...
</style>
</resources>
@rasoulmiri
rasoulmiri / style.xml (Flavor initial)
Last active Sep 18, 2017
style.xml (Flavor initial)
View style.xml (Flavor initial)
<resources>
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
//...
</style>
</resources>
View watch_card.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_margin="8dp"
View WatchAdapter.java
class WatchAdapter extends RecyclerView.Adapter<WatchAdapter.MyViewHolder> {
private Context context;
private List<Watch> watchList;
class MyViewHolder extends RecyclerView.ViewHolder {
TextView brand, color;
ImageView thumbnail;
MyViewHolder(View view) {
super(view);
@rasoulmiri
rasoulmiri / activity_main.xml
Last active Sep 18, 2017
activity_main.xml
View activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/gray"
android:descendantFocusability="beforeDescendants"
android:fitsSystemWindows="true"
android:focusableInTouchMode="true">
View MainActivity.java
public class MainActivity extends AppCompatActivity {
private RecyclerView recyclerView;
ProgressBar progressBar;
ImageView header;
private WatchAdapter adapter;
private List<Watch> watchList;
private int[] thumbnails = new int[]{R.drawable.watch_1, R.drawable.watch_2, R.drawable.watch_3, R.drawable.watch_4};
private String[] brands = new String[]{"Nike Sport Band","Nike Sport Band","Nike Sport Band","Nike Sport Band"};