Skip to content

Commit

Permalink
Merge pull request #11 from javiersantos/scroller
Browse files Browse the repository at this point in the history
Add scrollbar and remove main FAB
  • Loading branch information
javiersantos committed Jun 11, 2015
2 parents 2b31d9a + e46556a commit 4629934
Show file tree
Hide file tree
Showing 17 changed files with 48 additions and 75 deletions.
2 changes: 2 additions & 0 deletions app/app.iml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.mikepenz/iconics/1.0.2/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.mikepenz/materialdrawer/3.0.6/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.pnikosis/materialish-progress/1.5/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/xyz.danoz/recyclerviewfastscroller/0.1.3/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jacoco" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/javaResources" />
Expand Down Expand Up @@ -110,6 +111,7 @@
<orderEntry type="library" exported="" name="appcompat-v7-22.2.0" level="project" />
<orderEntry type="library" exported="" name="ambilwarna-2.0" level="project" />
<orderEntry type="library" exported="" name="material-dialogs-0.7.5.5" level="project" />
<orderEntry type="library" exported="" name="recyclerviewfastscroller-0.1.3" level="project" />
<orderEntry type="library" exported="" name="cardview-v7-22.2.0" level="project" />
</component>
</module>
5 changes: 3 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ android {
applicationId "com.javiersantos.mlmanager"
minSdkVersion 15
targetSdkVersion 22
versionCode 9
versionName "0.3.1"
versionCode 10
versionName "0.4.0"
}
buildTypes {
release {
Expand All @@ -31,6 +31,7 @@ dependencies {
compile 'com.afollestad:material-dialogs:0.7.5.5'
compile 'com.github.yukuku:ambilwarna:2.0'
compile 'com.pnikosis:materialish-progress:1.5'
compile 'xyz.danoz:recyclerviewfastscroller:0.1.3'
compile('com.mikepenz:materialdrawer:3.0.6@aar') {
transitive = true
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package com.javiersantos.mlmanager.activities;

import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.javiersantos.mlmanager.activities;

import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.graphics.drawable.Drawable;
Expand All @@ -20,11 +19,9 @@
import com.javiersantos.mlmanager.AppInfo;
import com.javiersantos.mlmanager.R;
import com.javiersantos.mlmanager.adapters.AppAdapter;
import com.javiersantos.mlmanager.listeners.HidingScrollListener;
import com.javiersantos.mlmanager.utils.AppPreferences;
import com.javiersantos.mlmanager.utils.UtilsApp;
import com.javiersantos.mlmanager.utils.UtilsUI;
import com.melnykov.fab.FloatingActionButton;
import com.pnikosis.materialishprogress.ProgressWheel;

import java.io.File;
Expand All @@ -33,6 +30,8 @@
import java.util.Comparator;
import java.util.List;

import xyz.danoz.recyclerviewfastscroller.vertical.VerticalRecyclerViewFastScroller;


public class MainActivity extends AppCompatActivity {
// Load Settings
Expand Down Expand Up @@ -60,7 +59,7 @@ public class MainActivity extends AppCompatActivity {
private Toolbar toolbar;
private Context context;
private RecyclerView recyclerView;
private FloatingActionButton fab;
private VerticalRecyclerViewFastScroller fastScroller;
private ProgressWheel progressWheel;

@Override
Expand All @@ -74,15 +73,18 @@ protected void onCreate(Bundle savedInstanceState) {
setAppDir();

recyclerView = (RecyclerView) findViewById(R.id.appList);
fastScroller = (VerticalRecyclerViewFastScroller) findViewById(R.id.fast_scroller);
progressWheel = (ProgressWheel) findViewById(R.id.progress);

fastScroller.setRecyclerView(recyclerView);
recyclerView.setOnScrollListener(fastScroller.getOnScrollListener());

recyclerView.setHasFixedSize(true);
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);
linearLayoutManager.setOrientation(LinearLayoutManager.VERTICAL);
recyclerView.setLayoutManager(linearLayoutManager);

setNavigationDrawer(appAdapter, appSystemAdapter, recyclerView);
setFAB();

progressWheel.setBarColor(appPreferences.getPrimaryColorPref());
progressWheel.setVisibility(View.VISIBLE);
Expand All @@ -109,36 +111,6 @@ private void setNavigationDrawer(AppAdapter appAdapter, AppAdapter appSystemAdap
UtilsUI.setNavigationDrawer(this, getApplicationContext(), toolbar, appAdapter, appSystemAdapter, recyclerView);
}

private void setFAB() {
fab = (FloatingActionButton) findViewById(R.id.fab);
if (appPreferences.getFABShowPref()) {
fab.setVisibility(View.VISIBLE);
fab.setImageDrawable(getResources().getDrawable(R.drawable.ic_settings));
fab.setBackgroundColor(appPreferences.getFABColorPref());
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
startActivity(new Intent(getApplicationContext(), SettingsActivity.class));
overridePendingTransition(R.anim.slide_in_right, R.anim.fade_back);
}
});

recyclerView.setOnScrollListener(new HidingScrollListener() {
@Override
public void onHide() {
fab.hide();
}

@Override
public void onShow() {
fab.show();
}
});
} else {
fab.setVisibility(View.INVISIBLE);
}
}

class getInstalledApps extends AsyncTask<Void, PackageInfo, Void> {
public getInstalledApps() {}

Expand Down Expand Up @@ -234,6 +206,7 @@ protected void onPostExecute(Void aVoid) {
appAdapter = new AppAdapter(createList(appListName, appListAPK, appListVersion, appListSource, appListData, appListIcon, false), context);
appSystemAdapter = new AppAdapter(createList(appSystemListName, appSystemListAPK, appSystemListVersion, appSystemListSource, appSystemListData, appSystemListIcon, true), context);

fastScroller.setVisibility(View.VISIBLE);
recyclerView.setAdapter(appAdapter);
progressWheel.setVisibility(View.GONE);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import android.content.SharedPreferences;
import android.os.Build;
import android.os.Bundle;
import android.preference.CheckBoxPreference;
import android.preference.ListPreference;
import android.preference.Preference;
import android.preference.PreferenceActivity;
Expand All @@ -27,7 +26,6 @@ public class SettingsActivity extends PreferenceActivity implements SharedPrefer
private SharedPreferences prefs;
private Preference prefVersion, prefDeleteAll, prefDefaultValues, prefNavigationBlack;
private AmbilWarnaPreference prefPrimaryColor, prefFABColor;
private CheckBoxPreference prefFABShow;
private ListPreference prefCustomFilename, prefSortMode;
private String versionName;
private int versionCode;
Expand All @@ -46,7 +44,6 @@ public void onCreate(Bundle savedInstanceState) {
prefVersion = findPreference("prefVersion");
prefPrimaryColor = (AmbilWarnaPreference) findPreference("prefPrimaryColor");
prefFABColor = (AmbilWarnaPreference) findPreference("prefFABColor");
prefFABShow = (CheckBoxPreference) findPreference("prefFABShow");
prefDeleteAll = findPreference("prefDeleteAll");
prefDefaultValues = findPreference("prefDefaultValues");
prefNavigationBlack = findPreference("prefNavigationBlack");
Expand Down Expand Up @@ -97,7 +94,6 @@ public boolean onPreferenceClick(Preference preference) {
public boolean onPreferenceClick(Preference preference) {
appPreferences.setPrimaryColorPref(getResources().getColor(R.color.primary));
appPreferences.setFABColorPref(getResources().getColor(R.color.fab));
prefFABShow.setChecked(false);
return true;
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import android.content.Intent;
import android.net.Uri;
import android.os.Environment;
import android.util.Log;

import com.javiersantos.mlmanager.AppInfo;

Expand Down
Binary file removed app/src/main/res/drawable-hdpi/ic_settings.png
Binary file not shown.
Binary file removed app/src/main/res/drawable-mdpi/ic_settings.png
Binary file not shown.
Binary file removed app/src/main/res/drawable-xhdpi/ic_settings.png
Binary file not shown.
Binary file removed app/src/main/res/drawable-xxhdpi/ic_settings.png
Binary file not shown.
8 changes: 8 additions & 0 deletions app/src/main/res/drawable/fastscroller_rounded.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<shape
xmlns:android="http://schemas.android.com/apk/res/android">

<solid android:color="@android:color/darker_gray" />

<corners android:radius="10dp" />

</shape>
5 changes: 2 additions & 3 deletions app/src/main/res/layout/activity_about.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
android:layout_width="match_parent"
android:layout_height="match_parent">
<include
android:id="@+id/toolbar"
layout="@layout/toolbar" />
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/activity_app.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
android:layout_width="match_parent"
android:layout_height="match_parent">
<include
android:id="@+id/toolbar"
layout="@layout/toolbar" />
Expand Down
40 changes: 23 additions & 17 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
@@ -1,38 +1,44 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:wheel="http://schemas.android.com/apk/res-auto"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
xmlns:recyclerviewfastscroller="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<include
android:id="@+id/toolbar"
layout="@layout/toolbar" />

<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/main_content"
android:layout_below="@id/toolbar">
<com.pnikosis.materialishprogress.ProgressWheel
android:id="@+id/progress"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_marginTop="200dp"
android:layout_gravity="center"
android:layout_centerInParent="true"
android:layout_gravity="center_vertical"
android:visibility="gone"
wheel:matProg_barColor="@color/primary"
wheel:matProg_progressIndeterminate="true" />
<android.support.v7.widget.RecyclerView
android:id="@+id/appList"
android:layout_width="match_parent"
android:layout_height="match_parent" />
android:layout_height="match_parent"
android:layout_marginRight="25dp" />
<xyz.danoz.recyclerviewfastscroller.vertical.VerticalRecyclerViewFastScroller
android:id="@+id/fast_scroller"
android:visibility="gone"
android:layout_width="24dp"
android:layout_height="match_parent"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:paddingRight="@dimen/margin_small"
android:paddingEnd="@dimen/margin_small"

</LinearLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<include
android:id="@+id/fab"
layout="@layout/fab" />
</FrameLayout>
recyclerviewfastscroller:rfs_barColor="@color/transparent"
recyclerviewfastscroller:rfs_handleBackground="@drawable/fastscroller_rounded"/>

</RelativeLayout>

</RelativeLayout>
2 changes: 0 additions & 2 deletions app/src/main/res/values-es/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@
<string name="app_description">Moderno, sencillo y personalizable gestor de aplicaciones para Android</string>
<string name="settings_googleplus">Únete a la comunidad en Google+</string>
<string name="settings_googleplus_description">¿Quieres estar al tanto de las novedades de la aplicación? ¡Únete a nuestra comunidad!</string>
<string name="settings_fab_show">Mostrar botón flotante principal</string>
<string name="settings_fab_show_description">No ocultar el butón flotante (FAB) en la pantalla principal. Requiere reiniciar.</string>
<string name="settings_custom_filename">Nombre de los archivos APK extraídos</string>
<string name="settings_sort_mode">Ordenar aplicaciones por</string>
<string name="action_apps">Aplicaciones Instaladas</string>
Expand Down
2 changes: 0 additions & 2 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@
<string name="settings_primary_color_description">Set the primary color for the toolbar and navigation bar. Requires Android 5.0+</string>
<string name="settings_fab_color">Floating button color</string>
<string name="settings_fab_color_description">Set the color for the Floating Action Button (FAB)</string>
<string name="settings_fab_show">Show floating button on main screen</string>
<string name="settings_fab_show_description">Don\'t hide the Floating Action Button (FAB) on the main screen. Restart required.</string>
<string name="settings_navigation_black">Show navigation bar in black</string>
<string name="settings_navigation_black_description">Don\'t use a custom color for the navigation bar.</string>
<string name="settings_default_customization">Restore customizations</string>
Expand Down
5 changes: 0 additions & 5 deletions app/src/main/res/xml/activity_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,6 @@
android:defaultValue="@color/fab"
android:title="@string/settings_fab_color"
android:summary="@string/settings_fab_color_description"/>
<CheckBoxPreference
android:key="prefFABShow"
android:title="@string/settings_fab_show"
android:summary="@string/settings_fab_show_description"
android:defaultValue="false" />
<CheckBoxPreference
android:key="prefNavigationBlack"
android:title="@string/settings_navigation_black"
Expand Down

0 comments on commit 4629934

Please sign in to comment.