Commit 937de386 authored by Donald Shtjefni's avatar Donald Shtjefni

Merge pull request #20 from Mow3l/master

Ui Tweeks (1° Activity)
parents 99a2c0d4 4c3ce8b9
package com.leafpic.app.Adapters; package com.leafpic.app.Adapters;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.graphics.PorterDuff;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
import android.support.v7.widget.RecyclerView; import android.support.v7.widget.RecyclerView;
import android.text.Html; import android.text.Html;
...@@ -62,13 +63,21 @@ public class AlbumsAdapter extends RecyclerView.Adapter<AlbumsAdapter.ViewHolder ...@@ -62,13 +63,21 @@ public class AlbumsAdapter extends RecyclerView.Adapter<AlbumsAdapter.ViewHolder
String SColor = SP.getString("PrefColor", "#03A9F4"); String SColor = SP.getString("PrefColor", "#03A9F4");
holder.nPhotos.setText(Html.fromHtml("<b><font color='" + SColor + "'>" + a.getImagesCount() + "</font></b>" + "<font " + holder.nPhotos.setText(Html.fromHtml("<b><font color='" + SColor + "'>" + a.getImagesCount() + "</font></b>" + "<font " +
"color='#FFFFFF'> Photos</font>")); "color='#FFFFFF'> Photos</font>"));//FFFFFF
holder.name.setTag(a.Path); holder.name.setTag(a.Path);
if (a.isSelected()) { if (a.isSelected()) {
holder.card_layout.setBackgroundColor(holder.card_layout.getContext().getColor(R.color.selected_album)); holder.card_layout.setBackgroundColor(holder.card_layout.getContext().getColor(R.color.selected_album));
holder.picture.setColorFilter(0x77000000, PorterDuff.Mode.SRC_ATOP);
holder.selectHolder.setVisibility(View.VISIBLE);
} else { } else {
holder.card_layout.setBackgroundColor(holder.card_layout.getContext().getColor(R.color.unselected_album)); holder.card_layout.setBackgroundColor(holder.card_layout.getContext().getColor(R.color.unselected_album));
//holder.picture.setColorFilter(0x00000000, PorterDuff.Mode.SRC_ATOP);
holder.picture.clearColorFilter();
holder.selectHolder.setVisibility(View.INVISIBLE);
} }
} }
...@@ -90,12 +99,14 @@ public class AlbumsAdapter extends RecyclerView.Adapter<AlbumsAdapter.ViewHolder ...@@ -90,12 +99,14 @@ public class AlbumsAdapter extends RecyclerView.Adapter<AlbumsAdapter.ViewHolder
public static class ViewHolder extends RecyclerView.ViewHolder { public static class ViewHolder extends RecyclerView.ViewHolder {
RelativeLayout card_layout; RelativeLayout card_layout;
ImageView picture; ImageView picture;
ImageView selectHolder;
TextView name; TextView name;
TextView nPhotos; TextView nPhotos;
public ViewHolder(View itemView) { public ViewHolder(View itemView) {
super(itemView); super(itemView);
picture = (ImageView) itemView.findViewById(R.id.picture); picture = (ImageView) itemView.findViewById(R.id.picture);
selectHolder = (ImageView) itemView.findViewById(R.id.selectedPicIcon);
card_layout = (RelativeLayout) itemView.findViewById(R.id.layout_card_id); card_layout = (RelativeLayout) itemView.findViewById(R.id.layout_card_id);
name = (TextView) itemView.findViewById(R.id.picturetext); name = (TextView) itemView.findViewById(R.id.picturetext);
nPhotos = (TextView) itemView.findViewById(R.id.image_number_text); nPhotos = (TextView) itemView.findViewById(R.id.image_number_text);
......
...@@ -140,7 +140,6 @@ public class AlbumsActivity extends AppCompatActivity implements FolderChooserDi ...@@ -140,7 +140,6 @@ public class AlbumsActivity extends AppCompatActivity implements FolderChooserDi
.withToolbar(toolbar) .withToolbar(toolbar)
.withAccountHeader(headerResult) .withAccountHeader(headerResult)
.withTranslucentStatusBar(false) .withTranslucentStatusBar(false)
.addDrawerItems( .addDrawerItems(
item1, item1,
item2, item2,
...@@ -505,6 +504,5 @@ public class AlbumsActivity extends AppCompatActivity implements FolderChooserDi ...@@ -505,6 +504,5 @@ public class AlbumsActivity extends AppCompatActivity implements FolderChooserDi
mRecyclerView.setLayoutManager(new GridLayoutManager(this, 2)); mRecyclerView.setLayoutManager(new GridLayoutManager(this, 2));
mRecyclerView.setItemAnimator(new DefaultItemAnimator()); mRecyclerView.setItemAnimator(new DefaultItemAnimator());
adapt.notifyDataSetChanged(); adapt.notifyDataSetChanged();
} }
} }
...@@ -8,6 +8,9 @@ ...@@ -8,6 +8,9 @@
android:orientation="vertical" android:orientation="vertical"
tools:context=".MainActivity" tools:context=".MainActivity"
android:background="@color/background_material_dark"> android:background="@color/background_material_dark">
<!--
android:background="@color/background_material_dark">
-->
<LinearLayout <LinearLayout
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
......
...@@ -17,22 +17,36 @@ ...@@ -17,22 +17,36 @@
android:id="@+id/layout_card_id" android:id="@+id/layout_card_id"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@color/unselected_album"> android:background="@color/toolbar">
<RelativeLayout
android:id="@+id/img"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView <ImageView
android:id="@+id/picture" android:id="@+id/selectedPicIcon"
android:layout_width="match_parent" android:layout_width="wrap_content"
android:layout_height="140dp" android:layout_height="wrap_content"
android:scaleType="centerCrop" android:visibility="invisible"
/>
android:elevation="10dp"
android:src="@mipmap/ic_done_white_48dp"
android:layout_gravity="center"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
/>
<ImageView
android:id="@+id/picture"
android:layout_width="match_parent"
android:layout_height="140dp"
android:scaleType="centerCrop"
/>
</RelativeLayout>
<!--VIEW divider DIVIDE IMMAGINE DALL TESTO SOTTO--> <!--VIEW divider DIVIDE IMMAGINE DALL TESTO SOTTO-->
<View <View
android:id="@+id/divider" android:id="@+id/divider"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_below="@id/picture" android:layout_below="@id/img"
android:background="@android:color/darker_gray" android:background="@android:color/darker_gray"
/> />
...@@ -57,7 +71,6 @@ ...@@ -57,7 +71,6 @@
android:textColor="@android:color/white" android:textColor="@android:color/white"
android:textSize="16sp" android:textSize="16sp"
/> />
<TextView <TextView
android:id="@+id/image_number_text" android:id="@+id/image_number_text"
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -68,7 +81,6 @@ ...@@ -68,7 +81,6 @@
android:textColor="@android:color/white" android:textColor="@android:color/white"
android:textSize="14sp" android:textSize="14sp"
/> />
</LinearLayout> </LinearLayout>
<!-- <ImageView android:id="@+id/image_menu" <!-- <ImageView android:id="@+id/image_menu"
android:layout_width="wrap_content" android:layout_width="wrap_content"
...@@ -79,7 +91,6 @@ ...@@ -79,7 +91,6 @@
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:layout_marginRight="5dp" android:layout_marginRight="5dp"
/>--> />-->
</RelativeLayout> </RelativeLayout>
</android.support.v7.widget.CardView> </android.support.v7.widget.CardView>
</FrameLayout> </FrameLayout>
\ No newline at end of file
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<string-array name="ColorsPref"> <string-array name="ColorsPref">
<item>#03A9F4</item> <item>#03A9F4</item>
<item>#009688</item> <item>#00796B</item>
<item>#FBC02D</item> <item>#FBC02D</item>
</string-array> </string-array>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<resources> <resources>
<!--BASE COLOR--> <!--BASE COLOR-->
<color name="status_bar">#00796b</color> <color name="status_bar">#00796b</color>
<color name="selected_album">#4db6ac</color> <color name="selected_album">#009688</color>
<color name="unselected_album">#424242</color> <color name="unselected_album">#424242</color>
<color name="navigation_bar">#009688</color> <color name="navigation_bar">#009688</color>
<color name="toolbar">#009688</color> <color name="toolbar">#009688</color>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment