Skip to content

Commit f88aac8

Browse files
committed
New SettingActivity(empty) and improvement
1 parent d18aea7 commit f88aac8

11 files changed

+135
-52
lines changed

app/build.gradle

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ plugins {
44

55
android {
66
compileSdk 32
7-
buildToolsVersion "32.0.0"
7+
buildToolsVersion "33.0.2"
88
useLibrary 'org.apache.http.legacy'
9+
namespace "android.code.editor"
910

1011
defaultConfig {
1112
applicationId "android.code.editor"
@@ -50,5 +51,5 @@ dependencies {
5051

5152

5253
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
53-
implementation 'com.google.android.material:material:1.6.1'
54+
implementation 'com.google.android.material:material:1.8.0'
5455
}

app/src/main/AndroidManifest.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@
1414
android:icon="@mipmap/ic_launcher"
1515
android:label="@string/app_name"
1616
android:roundIcon="@mipmap/ic_launcher_round"
17-
android:supportsRtl="true"
1817
android:requestLegacyExternalStorage="true"
19-
android:theme="@style/BrownishRed">
18+
android:theme="@style/AppTheme">
2019
<activity
2120
android:name=".MainActivity"
2221
android:exported="true">
@@ -37,6 +36,9 @@
3736
<activity
3837
android:name="android.code.editor.ContributorsActivity"
3938
android:exported="true" />
39+
<activity
40+
android:name="android.code.editor.SettingActivity"
41+
android:exported="true" />
4042
</application>
4143

4244
</manifest>

app/src/main/java/android/code/editor/FileManagerActivity.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import android.code.editor.files.utils.FileIcon;
44
import android.code.editor.files.utils.FileManager;
5+
import android.code.editor.ui.MaterialColorHelper;
56
import android.code.editor.ui.Utils;
67
import android.content.Intent;
78
import android.os.Bundle;
@@ -93,6 +94,7 @@ public boolean onOptionsItemSelected(MenuItem arg0) {
9394
PopupMenu popupMenu = new PopupMenu(FileManagerActivity.this, findViewById(R.id.menu_main_setting));
9495
Menu menu = popupMenu.getMenu();
9596
menu.add("Contributors");
97+
menu.add("Settings");
9698
popupMenu.setOnMenuItemClickListener(
9799
item -> {
98100
switch (item.getTitle().toString()) {
@@ -102,6 +104,11 @@ public boolean onOptionsItemSelected(MenuItem arg0) {
102104
FileManagerActivity.this, ContributorsActivity.class);
103105
startActivity(intent);
104106
break;
107+
case "Settings":
108+
Intent setting = new Intent();
109+
setting.setClass(
110+
FileManagerActivity.this, SettingActivity.class);
111+
startActivity(setting);
105112
default:
106113
return false;
107114
}
@@ -155,9 +162,9 @@ public void onBindViewHolder(ViewHolder _holder, final int _position) {
155162
mainlayout = _view.findViewById(R.id.layout);
156163
icon = _view.findViewById(R.id.icon);
157164
path = _view.findViewById(R.id.path);
158-
Utils.applyRippleEffect(mainlayout, "#ffffff", "#000000");
159165
FileIcon.setUpIcon(
160166
FileManagerActivity.this, _data.get(_position).get("path").toString(), icon);
167+
Utils.applyRippleEffect(mainlayout,MaterialColorHelper.getMaterialColor(FileManagerActivity.this,com.google.android.material.R.attr.colorSurface),MaterialColorHelper.getMaterialColor(FileManagerActivity.this,R.attr.colorOnSurface));
161168
path.setText(_data.get(_position).get("lastSegmentOfFilePath").toString());
162169
final String path = _data.get(_position).get("path").toString();
163170
if (new File(path).isDirectory()) {
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package android.code.editor;
2+
3+
import android.os.Bundle;
4+
import androidx.appcompat.app.AppCompatActivity;
5+
6+
public class SettingActivity extends AppCompatActivity {
7+
@Override
8+
protected void onCreate(Bundle arg0) {
9+
super.onCreate(arg0);
10+
// TODO: Implement this method
11+
setContentView(R.layout.activity_setting);
12+
}
13+
}
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<androidx.coordinatorlayout.widget.CoordinatorLayout
3+
xmlns:android="http://schemas.android.com/apk/res/android"
4+
xmlns:app="http://schemas.android.com/apk/res-auto"
5+
android:layout_height="match_parent"
6+
android:layout_width="match_parent"
7+
android:id="@+id/coordinator">
8+
9+
<com.google.android.material.appbar.AppBarLayout
10+
android:layout_height="wrap_content"
11+
android:layout_width="match_parent"
12+
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$Behavior"
13+
android:theme="@style/ThemeOverlay.MaterialComponents.Dark.ActionBar"
14+
android:id="@+id/appbar">
15+
16+
<com.google.android.material.appbar.MaterialToolbar
17+
android:layout_height="?attr/actionBarSize"
18+
android:layout_width="match_parent"
19+
android:background="?attr/colorPrimary"
20+
app:popupTheme="@style/ThemeOverlay.MaterialComponents.Light"
21+
android:id="@+id/toolbar" />
22+
23+
</com.google.android.material.appbar.AppBarLayout>
24+
25+
<ScrollView
26+
android:layout_height="wrap_content"
27+
android:layout_width="match_parent">
28+
29+
<LinearLayout
30+
android:layout_height="wrap_content"
31+
android:layout_width="match_parent"
32+
android:background="?attr/colorSurface"
33+
android:orientation="vertical">
34+
35+
<TextView
36+
android:layout_height="wrap_content"
37+
android:layout_width="wrap_content"
38+
android:layout_margin="8dp"
39+
android:text="Settings"
40+
android:textStyle="bold"
41+
android:textSize="22sp"/>
42+
43+
<LinearLayout
44+
android:layout_height="wrap_content"
45+
android:layout_width="match_parent"
46+
android:orientation="horizontal">
47+
48+
<LinearLayout
49+
android:layout_height="wrap_content"
50+
android:layout_width="wrap_content"
51+
android:orientation="vertical"
52+
android:layout_weight="1"
53+
android:padding="8dp">
54+
55+
<TextView
56+
android:layout_height="wrap_content"
57+
android:layout_width="wrap_content"
58+
android:text="Editor"
59+
android:textSize="16sp" />
60+
61+
<TextView
62+
android:layout_height="wrap_content"
63+
android:layout_width="wrap_content"
64+
android:text="Choose an code editor for you which is good for you."
65+
android:textSize="11sp" />
66+
67+
</LinearLayout>
68+
69+
<Spinner
70+
android:layout_height="wrap_content"
71+
android:layout_width="wrap_content"
72+
android:id="@+id/editorChooser">
73+
74+
</Spinner>
75+
76+
</LinearLayout>
77+
78+
</LinearLayout>
79+
80+
</ScrollView>
81+
82+
</androidx.coordinatorlayout.widget.CoordinatorLayout>

app/src/main/res/layout/filelist.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<ImageView
1616
android:layout_height="match_parent"
1717
android:layout_width="0dp"
18-
android:tint="?attr/colorPrimary"
18+
android:tint="?attr/colorOnSurface"
1919
android:layout_weight="10"
2020
android:id="@+id/icon"
2121
android:scaleType="fitCenter" />

app/src/main/res/values/styles.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<resources>
22
<!-- Base application theme. -->
33

4-
<style name="BrownishRed" parent="Theme.Material3.Light.NoActionBar">
4+
<style name="AppTheme" parent="Theme.Material3.Light.NoActionBar">
55
<item name="colorPrimary">@color/brownish_red_md_theme_light_primary</item>
66
<item name="colorOnPrimary">@color/brownish_red_md_theme_light_onPrimary</item>
77
<item name="colorPrimaryContainer">@color/brownish_red_md_theme_light_primaryContainer</item>

build.gradle

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,24 @@
1-
// Top-level build file where you can add configuration options common to all sub-projects/modules.
2-
plugins {
3-
id 'com.android.application' version '7.2.1' apply false
4-
id 'com.android.library' version '7.2.1' apply false
1+
buildscript {
2+
repositories {
3+
google()
4+
mavenCentral()
5+
6+
}
7+
dependencies {
8+
classpath 'com.android.tools.build:gradle:8.0.0'
9+
classpath 'com.google.gms:google-services:4.3.3'
10+
// NOTE: Do not place your application dependencies here; they belong
11+
// in the individual module build.gradle files
12+
}
13+
}
14+
15+
allprojects {
16+
repositories {
17+
google()
18+
mavenCentral()
19+
}
520
}
621

722
task clean(type: Delete) {
823
delete rootProject.buildDir
9-
}
24+
}

gradle.properties

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1 @@
1-
# Project-wide Gradle settings.
2-
# IDE (e.g. Android Studio) users:
3-
# Gradle settings configured through the IDE *will override*
4-
# any settings specified in this file.
5-
# For more details on how to configure your build environment visit
6-
# http://www.gradle.org/docs/current/userguide/build_environment.html
7-
# Specifies the JVM arguments used for the daemon process.
8-
# The setting is particularly useful for tweaking memory settings.
9-
org.gradle.jvmargs=-Xmx1024m -Dfile.encoding=UTF-8
10-
# When configured, Gradle will run in incubating parallel mode.
11-
# This option should only be used with decoupled projects. More details, visit
12-
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13-
# org.gradle.parallel=true
14-
# AndroidX package structure to make it clearer which packages are bundled with the
15-
# Android operating system, and which are packaged with your app"s APK
16-
# https://developer.android.com/topic/libraries/support-library/androidx-rn
17-
android.useAndroidX=true
18-
# Kotlin code style for this project: "official" or "obsolete":
19-
kotlin.code.style=official
20-
# Enables namespacing of each library's R class so that its R class includes only the
21-
# resources declared in the library itself and none from the library's dependencies,
22-
# thereby reducing the size of the R class for that library
23-
android.nonTransitiveRClass=true
1+
android.useAndroidX=true
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-all.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

settings.gradle

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1 @@
1-
pluginManagement {
2-
repositories {
3-
gradlePluginPortal()
4-
google()
5-
mavenCentral()
6-
}
7-
}
8-
dependencyResolutionManagement {
9-
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
10-
repositories {
11-
google()
12-
mavenCentral()
13-
}
14-
}
15-
rootProject.name = "Android Code Editor"
16-
include ':app'
1+
include ':app'

0 commit comments

Comments
 (0)