Removed all drawable and layout resources.

This commit is contained in:
Collinux 2018-04-13 10:28:52 -04:00
parent 8005e67b0e
commit 0ee860030a
8 changed files with 31 additions and 45 deletions

26
.gitignore vendored
View File

@ -12,43 +12,43 @@
*.class *.class
# Generated files # Generated files
android/bin/ bin/
android/en/ en/
andoid/out/ out/
# Gradle files # Gradle files
android/.gradle/ .gradle/
android/build/ build/
android/.gradle/ android/.gradle/
android/build/ build/
# Local configuration file (sdk path, etc) # Local configuration file (sdk path, etc)
android/local.properties local.properties
# Proguard folder generated by Eclipse # Proguard folder generated by Eclipse
android/proguard/ proguard/
# Log Files # Log Files
*.log *.log
# Android Studio Navigation editor temp files # Android Studio Navigation editor temp files
android/.navigation/ .navigation/
# Android Studio captures folder # Android Studio captures folder
android/captures/ captures/
# IntelliJ # IntelliJ
*.iml *.iml
.idea/ .idea/
android/.idea/ .idea/
# Keystore files # Keystore files
# Uncomment the following line if you do not want to check your keystore files in. # Uncomment the following line if you do not want to check your keystore files in.
#*.jks #*.jks
# External native build folder generated in Android Studio 2.2 and later # External native build folder generated in Android Studio 2.2 and later
android/.externalNativeBuild .externalNativeBuild
# Google Services (e.g. APIs or Firebase) # Google Services (e.g. APIs or Firebase)
android/google-services.json google-services.json

View File

@ -4,7 +4,7 @@ android {
compileSdkVersion 27 compileSdkVersion 27
defaultConfig { defaultConfig {
applicationId "launcher.simple.com.simplelauncher" applicationId "launcher.simple.com.simplelauncher"
minSdkVersion 16 minSdkVersion 4
targetSdkVersion 27 targetSdkVersion 27
versionCode 1 versionCode 1
versionName "1.0" versionName "1.0"
@ -12,7 +12,6 @@ android {
buildTypes { buildTypes {
release { release {
minifyEnabled true minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
} }
} }

View File

@ -6,6 +6,8 @@
android:icon="@android:drawable/ic_menu_sort_by_size" android:icon="@android:drawable/ic_menu_sort_by_size"
android:label="Minimalist Launcher" android:label="Minimalist Launcher"
android:excludeFromRecents="true" android:excludeFromRecents="true"
android:clearTaskOnLaunch="true"
android:stateNotNeeded="true"
android:theme="@android:style/Theme.Black.NoTitleBar"> android:theme="@android:style/Theme.Black.NoTitleBar">
<activity android:name=".MainActivity" <activity android:name=".MainActivity"

View File

@ -9,6 +9,7 @@ import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.provider.Settings; import android.provider.Settings;
import android.view.View; import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView; import android.widget.AdapterView;
import android.widget.ArrayAdapter; import android.widget.ArrayAdapter;
import android.widget.ListView; import android.widget.ListView;
@ -27,14 +28,21 @@ public class MainActivity extends Activity {
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// Setup UI elements
listView = new ListView(this);
listView.setVerticalScrollBarEnabled(false);
listView.setId(android.R.id.list);
listView.setDivider(null);
setContentView(listView);
ViewGroup.MarginLayoutParams p = (ViewGroup.MarginLayoutParams) listView.getLayoutParams();
p.setMargins(100, 0, 0, 0);
// Get a list of all the apps installed // Get a list of all the apps installed
packageManager = getPackageManager(); packageManager = getPackageManager();
adapter = new ArrayAdapter<>( adapter = new ArrayAdapter<String>(
this, R.layout.list_item, new ArrayList<String>()); this, android.R.layout.simple_list_item_1, new ArrayList<String>());
packageNames = new ArrayList<>(); packageNames = new ArrayList<>();
listView = findViewById(R.id.listView);
// Tap on an item in the list to launch the app // Tap on an item in the list to launch the app
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() { listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@ -67,7 +75,9 @@ public class MainActivity extends Activity {
} }
private void fetchAppList() { private void fetchAppList() {
adapter.clear(); // Start from a clean adapter when refreshing the list // Start from a clean adapter when refreshing the list
adapter.clear();
packageNames.clear();
// Query the package manager for all apps // Query the package manager for all apps
List<ResolveInfo> activities = packageManager.queryIntentActivities( List<ResolveInfo> activities = packageManager.queryIntentActivities(

View File

@ -1,4 +0,0 @@
<vector android:height="120dp" android:viewportHeight="24.0"
android:viewportWidth="24.0" android:width="120dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M3,18h18v-2L3,16v2zM3,13h18v-2L3,11v2zM3,6v2h18L21,6L3,6z"/>
</vector>

View File

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true"
android:drawable="@android:color/darker_gray" />
</selector>

View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<ListView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/listView"
android:scrollbars="none"
android:cacheColorHint="@android:color/black"
android:padding="24dp"/>

View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textColor="@android:color/white"
android:padding="16dp"
android:background="@drawable/list_item_style"
android:textAppearance="?android:attr/textAppearanceLarge"/>