Skip to content

Commit

Permalink
Switched to Material Design mode. Improved UI
Browse files Browse the repository at this point in the history
  • Loading branch information
mauriciotogneri committed Sep 11, 2016
1 parent e5bc097 commit cba0930
Show file tree
Hide file tree
Showing 15 changed files with 146 additions and 97 deletions.
19 changes: 18 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,27 @@ android
compileSdkVersion 24
buildToolsVersion "24.0.2"

dexOptions
{
javaMaxHeapSize "2g"
}

defaultConfig
{
applicationId "com.mauriciotogneri.fileexplorer"
minSdkVersion 14
targetSdkVersion 24
targetSdkVersion 22
versionCode 5
versionName "1.0.5"
}

signingConfigs
{
debug
{
storeFile file("debug.keystore")
}

release
{
keyAlias RELEASE_KEY_ALIAS
Expand All @@ -33,8 +43,14 @@ android

buildTypes
{
debug
{
debuggable true
}

release
{
minifyEnabled false
signingConfig signingConfigs.release
}
}
Expand All @@ -43,6 +59,7 @@ android
dependencies
{
compile 'com.android.support:support-v4:24.2.0'
compile 'com.android.support:appcompat-v7:24.2.0'
compile 'com.android.support:design:24.2.0'
compile 'ch.acra:acra:4.9.0'
}
Binary file added app/debug.keystore
Binary file not shown.
12 changes: 12 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<application
android:name=".app.FileExplorer"
android:allowBackup="true"
android:fullBackupContent="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/app_theme">
Expand All @@ -25,6 +26,17 @@
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>

<intent-filter>
<action android:name="android.intent.action.VIEW"/>

<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>

<data
android:host="mauriciotogneri.com"
android:scheme="http"/>
</intent-filter>

</activity>

</application>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,11 @@ else if (fileInfo.isVideo())

if (fileInfo.isSelected())
{
rowView.setBackgroundColor(ContextCompat.getColor(getContext(), R.color.gray4));
rowView.setBackgroundColor(ContextCompat.getColor(getContext(), R.color.gray5));
}
else
{
rowView.setBackgroundResource(R.drawable.background_list_row);
rowView.setBackgroundColor(0);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

import android.os.Bundle;
import android.os.Environment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.widget.TextView;

import com.mauriciotogneri.fileexplorer.R;
import com.mauriciotogneri.fileexplorer.fragments.FolderFragment;
Expand All @@ -13,7 +15,7 @@

import java.util.Stack;

public class MainActivity extends FragmentActivity
public class MainActivity extends AppCompatActivity
{
private ToolBar toolBar;
private ButtonBar buttonBar;
Expand All @@ -25,7 +27,10 @@ protected void onCreate(Bundle savedInstanceState)
super.onCreate(savedInstanceState);
setContentView(R.layout.screen_main);

this.toolBar = new ToolBar(findViewById(R.id.toolBar));
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);

this.toolBar = new ToolBar((TextView) findViewById(R.id.folderName));
this.buttonBar = new ButtonBar(findViewById(R.id.buttonBar), fragments);

String root = Environment.getExternalStorageDirectory().getAbsolutePath();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
package com.mauriciotogneri.fileexplorer.utils;

import android.view.View;
import android.widget.TextView;

import com.mauriciotogneri.fileexplorer.R;
import com.mauriciotogneri.fileexplorer.fragments.FolderFragment;

public class ToolBar
{
private final TextView folderName;

public ToolBar(View parent)
public ToolBar(TextView textview)
{
this.folderName = (TextView) parent.findViewById(R.id.folderName);
this.folderName = textview;
}

public void update(FolderFragment fragment)
Expand Down
23 changes: 0 additions & 23 deletions app/src/main/res/drawable/background_list_row.xml

This file was deleted.

2 changes: 1 addition & 1 deletion app/src/main/res/drawable/extension_border.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@

<stroke
android:width="2px"
android:color="@color/gray2"/>
android:color="@color/gray3"/>

</shape>
11 changes: 11 additions & 0 deletions app/src/main/res/drawable/toolbar_shadow.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">

<gradient
android:angle="90"
android:endColor="#88888888"
android:startColor="@android:color/transparent"/>

</shape>
5 changes: 2 additions & 3 deletions app/src/main/res/layout/row_file.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/background_list_row"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="10dp">
Expand All @@ -27,9 +26,9 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="2dp"
android:background="@drawable/extension_border"
android:paddingBottom="2dp"
android:layout_marginTop="2dp"
android:paddingLeft="3dp"
android:paddingRight="3dp"
android:paddingTop="2dp"
Expand Down Expand Up @@ -58,7 +57,7 @@
style="@style/defaultText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/gray2"
android:textColor="@color/gray3"
android:textSize="14sp"
tools:text="@string/dummy_text"/>

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/screen_folder.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/white"
android:divider="@color/gray3"
android:divider="@color/gray4"
android:dividerHeight="0.2dp"/>

<TextView
Expand Down
100 changes: 45 additions & 55 deletions app/src/main/res/layout/screen_main.xml
Original file line number Diff line number Diff line change
@@ -1,70 +1,60 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">

<LinearLayout
android:id="@+id/toolBar"
android:layout_width="match_parent"
android:layout_height="56dp"
android:background="@color/blue2"
android:gravity="center_vertical"
android:orientation="horizontal">

<TextView
android:id="@+id/folderName"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:ellipsize="start"
android:gravity="center_vertical"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:singleLine="true"
android:textColor="@android:color/white"
android:textSize="20sp"
tools:text="@string/dummy_text"/>
<include
layout="@layout/toolbar"/>

</LinearLayout>

<RelativeLayout
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">

<FrameLayout
android:id="@+id/fragment_container"
xmlns:android="http://schemas.android.com/apk/res/android"
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"/>

<LinearLayout
android:id="@+id/buttonBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_margin="0dp"
android:orientation="vertical">

<android.support.design.widget.FloatingActionButton
android:id="@+id/button.selectAll"
style="@style/floatingButton"
android:src="@drawable/ic_select"/>

<android.support.design.widget.FloatingActionButton
android:id="@+id/button.share"
style="@style/floatingButton"
android:src="@drawable/ic_share"/>

<android.support.design.widget.FloatingActionButton
android:id="@+id/button.delete"
style="@style/floatingButton"
android:src="@drawable/ic_delete"/>

</LinearLayout>
android:layout_height="match_parent">

<FrameLayout
android:id="@+id/fragment_container"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"/>

<LinearLayout
android:id="@+id/buttonBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_margin="0dp"
android:orientation="vertical">

<android.support.design.widget.FloatingActionButton
android:id="@+id/button.selectAll"
style="@style/floatingButton"
android:src="@drawable/ic_select"/>

<android.support.design.widget.FloatingActionButton
android:id="@+id/button.share"
style="@style/floatingButton"
android:src="@drawable/ic_share"/>

<android.support.design.widget.FloatingActionButton
android:id="@+id/button.delete"
style="@style/floatingButton"
android:src="@drawable/ic_delete"/>

</LinearLayout>

</RelativeLayout>

<View
android:layout_width="match_parent"
android:layout_height="3dp"
android:background="@drawable/toolbar_shadow"/>

</RelativeLayout>
</FrameLayout>

</LinearLayout>
27 changes: 27 additions & 0 deletions app/src/main/res/layout/toolbar.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/blue2"
android:gravity="center_vertical"
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:titleTextColor="@color/white">

<TextView
android:id="@+id/folderName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:ellipsize="start"
android:gravity="center_vertical"
android:paddingRight="10dp"
android:singleLine="true"
android:textColor="@color/white"
android:textSize="20sp"
tools:text="@string/dummy_text"/>

</android.support.v7.widget.Toolbar>
9 changes: 6 additions & 3 deletions app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@
<resources>

<color name="gray1">#666666</color>
<color name="gray2">#AAAAAA</color>
<color name="gray3">#CCCCCC</color>
<color name="gray4">#DDDDDD</color>
<color name="gray2">#888888</color>
<color name="gray3">#AAAAAA</color>
<color name="gray4">#CCCCCC</color>
<color name="gray5">#DDDDDD</color>

<color name="blue1">#0075A8</color>
<color name="blue2">#0081BA</color>

<color name="white">#FFFFFF</color>

</resources>
Loading

0 comments on commit cba0930

Please sign in to comment.