Skip to content

Commit

Permalink
Add all the application files
Browse files Browse the repository at this point in the history
  • Loading branch information
falzonv committed Feb 17, 2021
1 parent 0293b40 commit 84a6227
Show file tree
Hide file tree
Showing 56 changed files with 1,531 additions and 2 deletions.
29 changes: 27 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,27 @@
# discreet-launcher
Coming soon
# Discreet Launcher

Enjoy a clean home screen while accessing everything in an instant!

![ApplicationIcon](app/src/main/res/mipmap-hdpi/ic_launcher_round.png)

**Available soon !**

Discreet Launcher provides you a distraction-free home screen, allowing you to fully enjoy your
wallpaper (only the status and navigation bars have been kept for convenience).

From this clean home screen, simply slide your finger down to display your favorites applications
or up to see the complete list of applications.

Both for speed and to limit battery usage, the list of installed applications is fetched only when
Discreet Launcher starts. You can refresh it at any time from the menu, for example if a newly
installed application does not appear.

Discreet Launcher is open source, doesn't require any unnecessary permission, works completely
offline and doesn't include any advertisements.

## Screenshots

![Screenshot1](fastlane/metadata/android/en-US/images/phoneScreenshots/1.png)
![Screenshot2](fastlane/metadata/android/en-US/images/phoneScreenshots/2.png)
![Screenshot3](fastlane/metadata/android/en-US/images/phoneScreenshots/3.png)
![Screenshot4](fastlane/metadata/android/en-US/images/phoneScreenshots/4.png)
50 changes: 50 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
// Apply the Android plugin to Gradle and make the "android" block available
apply plugin: 'com.android.application'

// Build options
android
{
// API level used to compile the application
compileSdkVersion 30
buildToolsVersion "30.0.2"

defaultConfig
{
// Application identifier
applicationId "com.vincent_falzon.discreetlauncher"

// Minimum API required and API used for compilation
minSdkVersion 21
targetSdkVersion 30

// Versioning
versionCode 1
versionName "v1.0.0"
}

// Build types always includes debug (hidden by default)
buildTypes
{
debug
{
// Allow usage of the version name in XML
resValue "string", "app_version", "${defaultConfig.versionName}.dbg"
}
release
{
// Enable code shrinking, obfuscation and optimization to lower APK size
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'

// Allow usage of the version name in XML
resValue "string", "app_version", "${defaultConfig.versionName}"
}
}
}

// External requirements
dependencies
{
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
}
29 changes: 29 additions & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile

# Shrink and obfuscate only Android libraries
-keep class com.vincent_falzon.discreetlauncher.*
{
<fields> ;
<init>() ;
<methods> ;
}
40 changes: 40 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.vincent_falzon.discreetlauncher">

<!-- Required for Android 11+ (<queries> not applicable for Launcher applications) -->
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES"
tools:ignore="QueryAllPackagesPermission" />

<application
android:allowBackup="false"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">

<activity
android:name=".ActivityMain"
android:label="@string/app_name"
android:launchMode="singleTask"
android:excludeFromRecents="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>

<activity
android:name=".ActivityDrawer"
android:label="@string/drawer_activity_title"
android:parentActivityName=".ActivityMain"
android:excludeFromRecents="true"/>

</application>

</manifest>
Binary file added app/src/main/ic_launcher-playstore.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
package com.vincent_falzon.discreetlauncher;

// License
/*
This file is part of Discreet Launcher.
Copyright (C) 2019-2021 Vincent Falzon
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

// Imports
import android.os.Bundle ;
import androidx.annotation.NonNull ;
import androidx.appcompat.app.AppCompatActivity ;
import androidx.recyclerview.widget.GridLayoutManager ;
import androidx.recyclerview.widget.RecyclerView ;
import android.widget.TextView ;

/**
* Applications drawer activity.
*/
public class ActivityDrawer extends AppCompatActivity
{
// Attributes
private GridLayoutManager layoutManager ;
private int position ;
private int last_position ;


/**
* Constructor.
* @param savedInstanceState To retrieve the context
*/
@Override
protected void onCreate(Bundle savedInstanceState)
{
// Call the constructor of the parent class
super.onCreate(savedInstanceState) ;

// Initializations
setContentView(R.layout.activity_drawer) ;
RecyclerView recycler = findViewById(R.id.applications_list) ;
layoutManager = new GridLayoutManager(this, 4) ;

// Indicate the last time the applications list was updated
String text = getResources().getString(R.string.text_applications_list_last_update) + " " + ActivityMain.getListLastUpdate() + ")" ;
TextView lastUpdateDateTime = findViewById(R.id.last_update_datetime) ;
lastUpdateDateTime.setText(text) ;

// Follow the scrolling position to detect when it is stuck on top
position = 0 ;
last_position = -1 ;
recycler.addOnScrollListener(new RecyclerView.OnScrollListener()
{
/**
* When the scrolling ends, check if it is stuck on top.
* @param recyclerView Scrolled RecyclerView
* @param newState 0 (Not scrolling), 1 (Active scrolling) or 2 (Scrolling inerty)
*/
@Override
public void onScrollStateChanged(@NonNull RecyclerView recyclerView, int newState)
{
// Let the parent actions be performed
super.onScrollStateChanged(recyclerView, newState) ;

// Wait for the gesture to be finished
if(newState == RecyclerView.SCROLL_STATE_IDLE)
{
// If the scrolling is stuck on top, close the drawer activity
if((position == 0) && (last_position == 0)) finish() ;

// Update the last position to detect the stuck state
last_position = position ;
}
}


/**
* Update the position of the first visible item as the user is scrolling.
* @param recyclerView Scrolled RecyclerView
* @param dx Horizontal distance
* @param dy Vertical distance
*/
@Override
public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy)
{
// Let the parent actions be performed
super.onScrolled(recyclerView, dx, dy) ;

// Update the position of the first visible item
position = layoutManager.findFirstCompletelyVisibleItemPosition() ;
}
}) ;

// Display the applications list
recycler.setAdapter(new RecyclerAdapter(this, false)) ;
recycler.setLayoutManager(layoutManager) ;
}
}
Loading

0 comments on commit 84a6227

Please sign in to comment.