Commit 8589f14c authored by Gilbert Ndresaj's avatar Gilbert Ndresaj

Layout Clean & Stuff 2

parent 902df791
......@@ -7,12 +7,14 @@ package org.horaapps.leafpic;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.res.ColorStateList;
import android.graphics.Color;
import android.os.Environment;
import android.support.annotation.NonNull;
import android.support.design.widget.BottomSheetBehavior;
import android.support.design.widget.BottomSheetDialogFragment;
import android.support.design.widget.CoordinatorLayout;
import android.support.design.widget.FloatingActionButton;
import android.support.v4.app.FragmentManager;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AlertDialog;
......@@ -58,6 +60,7 @@ public class SelectAlbumBuilder extends BottomSheetDialogFragment {
private TextView currentFolderPath;
private OnFolderSelected onFolderSelected;
FragmentManager fragmentManager;
private FloatingActionButton fabDone;
final int INTERNAL_STORAGE = 0;
......@@ -120,7 +123,7 @@ public class SelectAlbumBuilder extends BottomSheetDialogFragment {
super.setupDialog(dialog, style);
View contentView = View.inflate(getContext(), R.layout.select_folder_bottom_sheet, null);
final RecyclerView mRecyclerView = (RecyclerView) contentView.findViewById(R.id.folders);
final Spinner spinner = (Spinner) contentView.findViewById(R.id.volume_spinner);
final Spinner spinner = (Spinner) contentView.findViewById(R.id.storage_spinner);
currentFolderPath = (TextView) contentView.findViewById(R.id.bottom_sheet_sub_title);
exploreModePanel = (LinearLayout) contentView.findViewById(R.id.ll_explore_mode_panel);
imgExploreMode = (IconicsImageView) contentView.findViewById(R.id.toggle_hidden_icon);
......@@ -166,42 +169,48 @@ public class SelectAlbumBuilder extends BottomSheetDialogFragment {
contentView.findViewById(R.id.ll_select_folder).setBackgroundColor(theme.getCardBackgroundColor());
theme.setColorScrollBarDrawable(ContextCompat.getDrawable(dialog.getContext(), R.drawable.ic_scrollbar));
((TextView) contentView.findViewById(R.id.bottom_sheet_title)).setText(title);
contentView.findViewById(R.id.done).setOnClickListener(new View.OnClickListener() {
fabDone = (FloatingActionButton) contentView.findViewById(R.id.fab_bottomsheet_done);
fabDone.setBackgroundTintList(ColorStateList.valueOf(theme.getAccentColor()));
fabDone.setImageDrawable(new IconicsDrawable(getContext()).icon(GoogleMaterial.Icon.gmd_done).color(Color.WHITE));
fabDone.setVisibility(exploreMode ? View.VISIBLE : View.GONE);
fabDone.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
public void onClick(View v) {
dismiss();
onFolderSelected.folderSelected(currentFolderPath.getText().toString());
}
});
contentView.findViewById(R.id.create_new_folder).setOnClickListener(new View.OnClickListener() {
((TextView) contentView.findViewById(R.id.bottom_sheet_title)).setText(title);
contentView.findViewById(R.id.rl_create_new_folder).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
final EditText editText = new EditText(getContext());
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity(), theme.getDialogStyle());
AlertDialogsHelper.getInsertTextDialog(((ThemedActivity) getActivity()), builder,
editText, R.string.new_folder);
builder.setPositiveButton(R.string.ok_action, new DialogInterface.OnClickListener() {
builder.setPositiveButton(getString(R.string.ok_action).toUpperCase(), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
File folderPath = new File(currentFolderPath.getText().toString() + File.separator + editText.getText().toString());
if (folderPath.mkdir()) displayContentFolder(folderPath);
}
});
builder.setNegativeButton(getString(R.string.cancel).toUpperCase(), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {}
});
builder.show();
}
});
contentView.findViewById(R.id.rl_bottom_sheet_title).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (!forzed)
if (!forzed) {
toggleExplorerMode(!exploreMode);
fabDone.setVisibility(exploreMode ? View.VISIBLE : View.GONE);
}
}
});
......
......@@ -3,11 +3,14 @@ package org.horaapps.leafpic.activities;
import android.annotation.TargetApi;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.res.ColorStateList;
import android.database.Cursor;
import android.graphics.Color;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.provider.MediaStore;
import android.support.design.widget.FloatingActionButton;
import android.support.v7.app.AlertDialog;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.GridLayoutManager;
......@@ -24,6 +27,7 @@ import android.widget.TextView;
import android.widget.Toast;
import com.mikepenz.google_material_typeface_library.GoogleMaterial;
import com.mikepenz.iconics.IconicsDrawable;
import com.mikepenz.iconics.view.IconicsImageView;
import org.horaapps.leafpic.R;
......@@ -44,6 +48,7 @@ public class WhiteListActivity extends ThemedActivity {
HandlingAlbums tracker;
private int REQUEST_CODE_SD_CARD_PERMISSIONS = 42;
private FloatingActionButton fabWHDone;
ArrayList<Item> folders = new ArrayList<>();
ArrayList<String> alreadyTracked;
......@@ -115,7 +120,7 @@ public class WhiteListActivity extends ThemedActivity {
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.menu_track_albums, menu);
menu.findItem(R.id.action_done).setIcon(getToolbarIcon(GoogleMaterial.Icon.gmd_done));
//menu.findItem(R.id.action_done).setIcon(getToolbarIcon(GoogleMaterial.Icon.gmd_done));
return true;
}
......@@ -123,11 +128,12 @@ public class WhiteListActivity extends ThemedActivity {
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
/*
case R.id.action_done:
tracker.handleItems(folders);
finish();
return true;
*/
case R.id.action_show_music:
Toast.makeText(this, "Fuck!", Toast.LENGTH_SHORT).show();
return true;
......@@ -154,6 +160,19 @@ public class WhiteListActivity extends ThemedActivity {
mRecyclerView.setItemAnimator(new DefaultItemAnimator());
mRecyclerView.setBackgroundColor(getBackgroundColor());
/** FAB **/
fabWHDone = (FloatingActionButton) findViewById(R.id.fab_whitelist_done);
fabWHDone.setBackgroundTintList(ColorStateList.valueOf(getAccentColor()));
fabWHDone.setImageDrawable(new IconicsDrawable(this).icon(GoogleMaterial.Icon.gmd_done).color(Color.WHITE));
fabWHDone.setVisibility(View.VISIBLE);
fabWHDone.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
tracker.handleItems(folders);
finish();
}
});
/**SET UP UI COLORS**/
toolbar.setBackgroundColor(getPrimaryColor());
toolbar.setNavigationIcon(getToolbarIcon(GoogleMaterial.Icon.gmd_arrow_back));
......
......@@ -33,10 +33,9 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
android:clipToPadding="false"
android:scrollbars="vertical"
android:scrollbarThumbVertical="@drawable/ic_scrollbar"
android:clipToPadding="false"
/>
<android.support.v7.widget.RecyclerView
android:id="@+id/grid_photos"
......@@ -44,6 +43,8 @@
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
android:clipToPadding="false"
android:scrollbars="vertical"
android:scrollbarThumbVertical="@drawable/ic_scrollbar"
/>
<!--
android:scrollbars="vertical"
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/ll_select_folder"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<include
android:id="@+id/toolbar"
layout="@layout/toolbar"
android:background="@color/md_dark_appbar"
android:windowActionBarOverlay="true"
/>
<RelativeLayout
android:id="@+id/rl_ea"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView
android:id="@+id/excluded_albums"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="vertical"
android:layout_height="wrap_content"
android:orientation="vertical">
<include
android:id="@+id/toolbar"
layout="@layout/toolbar"
android:background="@color/md_dark_appbar"
android:windowActionBarOverlay="true"
/>
<TextView
<RelativeLayout
android:id="@+id/rl_ea"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/nothing_to_show"
android:text="@string/there_is_nothing_to_show"
android:textColor="@color/md_white_1000"
android:visibility="invisible"
android:textSize="@dimen/sub_big_text"
android:gravity="center"
android:layout_centerInParent="true"
/>
</RelativeLayout>
android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView
android:id="@+id/excluded_albums"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="vertical"
android:scrollbarThumbVertical="@drawable/ic_scrollbar"
/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/nothing_to_show"
android:text="@string/there_is_nothing_to_show"
android:textColor="@color/md_white_1000"
android:visibility="invisible"
android:textSize="@dimen/sub_big_text"
android:gravity="center"
android:layout_centerInParent="true"
/>
</RelativeLayout>
</LinearLayout>
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab_whitelist_done"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/fab_layout_margin"
app:elevation="@dimen/fab_elevation"
app:pressedTranslationZ="@dimen/fab_pressed_translationZ"
android:layout_alignParentBottom="true"
android:layout_alignParentEnd="true"
android:layout_gravity="bottom|end"
android:theme="@style/ThemeOverlay.AppCompat.Light"
app:layout_behavior="org.horaapps.leafpic.views.FabScrollBehaviour" />
</LinearLayout>
\ No newline at end of file
</android.support.design.widget.CoordinatorLayout>
\ No newline at end of file
......@@ -69,42 +69,35 @@
</RelativeLayout>
<LinearLayout
android:id="@+id/ll_explore_mode_panel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/ll_explore_mode_panel"
android:orientation="horizontal"
android:gravity="center_vertical"
android:paddingStart="10dp"
android:weightSum="10">
android:paddingStart="10dp">
<Spinner
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/volume_spinner"
android:spinnerMode="dropdown"
android:layout_weight="8" />
<com.mikepenz.iconics.view.IconicsImageView
android:layout_height="@dimen/icon_width_height"
android:layout_width="@dimen/icon_width_height"
android:id="@+id/create_new_folder"
android:layout_gravity="center_vertical"
android:layout_marginLeft="@dimen/big_spacing"
android:layout_marginRight="@dimen/big_spacing"
android:clickable="true"
android:background="@drawable/ripple"
app:iiv_icon="gmd-create-new-folder"
app:iiv_color="@color/md_white_1000"
android:layout_weight="1" />
<com.mikepenz.iconics.view.IconicsImageView
android:id="@+id/done"
android:layout_height="@dimen/icon_width_height"
android:layout_width="@dimen/icon_width_height"
android:layout_marginEnd="@dimen/big_spacing"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:id="@+id/storage_spinner"
android:spinnerMode="dropdown"/>
<RelativeLayout
android:id="@+id/rl_create_new_folder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="@dimen/medium_spacing"
android:paddingBottom="@dimen/medium_spacing"
android:foreground="@drawable/ripple"
android:clickable="true"
android:background="@drawable/ripple"
app:iiv_icon="gmd-done"
app:iiv_color="@color/md_white_1000"
/>
>
<com.mikepenz.iconics.view.IconicsImageView
android:layout_height="@dimen/icon_width_height"
android:layout_width="@dimen/icon_width_height"
android:layout_marginEnd="@dimen/big_spacing"
android:layout_alignParentEnd="true"
android:layout_gravity="end"
app:iiv_icon="gmd-create-new-folder"
app:iiv_color="@color/md_white_1000"/>
</RelativeLayout>
</LinearLayout>
</LinearLayout>
......@@ -119,12 +112,11 @@
</LinearLayout>
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab_camera"
android:id="@+id/fab_bottomsheet_done"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/fab_layout_margin"
app:elevation="@dimen/fab_elevation"
app:pressedTranslationZ="@dimen/fab_pressed_translationZ"
android:layout_alignParentBottom="true"
android:layout_alignParentEnd="true"
......
<menu
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<!--
<item
android:id="@+id/action_done"
android:title="@string/done"
app:showAsAction="always"
/>
-->
<item
android:id="@+id/action_show_music"
android:title="Show Music folder"
......
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