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

View File

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

View File

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

View File

@ -9,6 +9,7 @@ import android.net.Uri;
import android.os.Bundle;
import android.provider.Settings;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
@ -27,14 +28,21 @@ public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle 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
packageManager = getPackageManager();
adapter = new ArrayAdapter<>(
this, R.layout.list_item, new ArrayList<String>());
adapter = new ArrayAdapter<String>(
this, android.R.layout.simple_list_item_1, new ArrayList<String>());
packageNames = new ArrayList<>();
listView = findViewById(R.id.listView);
// Tap on an item in the list to launch the app
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@ -67,7 +75,9 @@ public class MainActivity extends Activity {
}
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
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"/>