Skip to content

Commit f110089

Browse files
committed
Projekt hinzufügen Design verbessert
1 parent 851748e commit f110089

File tree

6 files changed

+98
-31
lines changed

6 files changed

+98
-31
lines changed

.idea/misc.xml

Lines changed: 4 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ dependencies {
6767
implementation 'com.github.bumptech.glide:glide:4.12.0'
6868
annotationProcessor 'com.github.bumptech.glide:compiler:4.12.0'
6969

70-
//Color Picker (https://github.com/msasikanth/ColorSheet)
71-
implementation "dev.sasikanth:colorsheet:1.0.1"
70+
//Color Picker (https://github.com/kristiyanP/colorpicker)
71+
implementation 'petrov.kristiyan:colorpicker-library:1.1.10'
7272

7373
}

app/src/main/java/de/hochschulehannover/myprojects/AddProject.java

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66

77
import android.app.DatePickerDialog;
88
import android.content.ContentValues;
9-
import android.database.Cursor;
109
import android.database.sqlite.SQLiteDatabase;
10+
import android.graphics.Color;
11+
import android.graphics.drawable.GradientDrawable;
1112
import android.os.Bundle;
1213
import android.text.InputType;
13-
import android.util.Log;
1414
import android.view.View;
1515
import android.widget.ArrayAdapter;
1616
import android.widget.Button;
@@ -21,7 +21,7 @@
2121

2222
import java.util.Calendar;
2323

24-
import dev.sasikanth.colorsheet.ColorSheet;
24+
import petrov.kristiyan.colorpicker.ColorPicker;
2525

2626
public class AddProject extends AppCompatActivity {
2727

@@ -32,7 +32,7 @@ public class AddProject extends AppCompatActivity {
3232
TextView endDateEditText;
3333
DatePickerDialog picker;
3434

35-
Button pickColor;
35+
Button pickColorButton;
3636

3737
public void addProject(View view) {
3838
DBHelper dbHelper = new DBHelper(this);
@@ -65,12 +65,29 @@ protected void onCreate(Bundle savedInstanceState) {
6565
super.onCreate(savedInstanceState);
6666
setContentView(R.layout.activity_add_project);
6767

68-
pickColor = findViewById(R.id.pickColorButton);
68+
pickColorButton = findViewById(R.id.pickColorButton);
6969

70-
pickColor.setOnClickListener(new View.OnClickListener() {
70+
pickColorButton.setOnClickListener(new View.OnClickListener() {
7171
@Override
7272
public void onClick(View view) {
73-
//new ColorSheet().colorPicker().show();
73+
ColorPicker colorPicker = new ColorPicker(AddProject.this);
74+
colorPicker.setOnChooseColorListener(new ColorPicker.OnChooseColorListener() {
75+
@Override
76+
public void onChooseColor(int position,int color) {
77+
pickColorButton.setBackgroundColor(color);
78+
//view.background.colorFilter = BlendModeColorFilter(Color.parseColor("#343434"), BlendMode.SRC_ATOP)
79+
//GradientDrawable bgShape = (GradientDrawable)pickColorButton.getBackground();
80+
//bgShape.setColor(color);
81+
}
82+
83+
@Override
84+
public void onCancel(){
85+
// put code
86+
}
87+
})
88+
.setTitle("Wähle eine Farbe für dein Projekt")
89+
.setRoundColorButton(true)
90+
.show();
7491

7592
}
7693
});
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<shape
3+
xmlns:android="http://schemas.android.com/apk/res/android"
4+
android:shape="oval">
5+
6+
<solid
7+
android:color="?colorPrimary"/>
8+
9+
<size
10+
android:width="80dp"
11+
android:height="80dp"/>
12+
</shape>

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

Lines changed: 51 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,62 @@
3838
android:layout_width="match_parent"
3939
android:layout_height="wrap_content"
4040
android:gravity="center_horizontal"
41+
android:orientation="vertical"
4142
android:padding="16dp">
4243

44+
4345
<Button
4446
android:id="@+id/pickColorButton"
47+
android:layout_width="100dp"
48+
android:layout_height="100dp"
49+
android:text="+"
50+
app:cornerRadius="250dp" />
51+
52+
<TextView
53+
android:layout_width="match_parent"
54+
android:layout_height="wrap_content"
55+
android:text="Farbe auswählen"
56+
android:textSize="20sp"
57+
android:textColor="@color/primary_text_color"
58+
android:textAlignment="center" />
59+
60+
<com.google.android.material.textfield.TextInputLayout
61+
android:layout_width="match_parent"
62+
android:layout_height="wrap_content"
63+
android:layout_marginTop="20dp">
64+
65+
<androidx.appcompat.widget.AppCompatEditText
66+
android:layout_width="match_parent"
67+
android:layout_height="wrap_content"
68+
android:hint="@string/project_name"
69+
android:inputType="text"
70+
android:textSize="16sp" />
71+
</com.google.android.material.textfield.TextInputLayout>
72+
73+
<com.google.android.material.textfield.TextInputLayout
74+
android:layout_width="match_parent"
75+
android:layout_height="wrap_content"
76+
android:layout_marginTop="20dp"
77+
style="@style/Widget.MaterialComponents.TextInputLayout.FilledBox.ExposedDropdownMenu"
78+
android:hint="@string/project_status">
79+
80+
<AutoCompleteTextView
81+
android:layout_width="match_parent"
82+
android:layout_height="wrap_content"
83+
android:inputType="none"
84+
/>
85+
86+
</com.google.android.material.textfield.TextInputLayout>
87+
88+
<com.google.android.material.textfield.TextInputEditText
89+
android:id="@+id/projectNameEditText"
4590
android:layout_width="wrap_content"
4691
android:layout_height="match_parent"
47-
android:text="Farbe auswählen" />
92+
android:hint="Tag setzen"
93+
android:inputType="text"
94+
android:textSize="18sp"
95+
android:layout_gravity="start"/>
96+
4897

4998
</LinearLayout>
5099

@@ -67,7 +116,7 @@
67116
app:layout_constraintTop_toTopOf="parent" />
68117

69118
<EditText
70-
android:id="@+id/projectNameEditText"
119+
android:id="@+id/projectNameEditText_old"
71120
android:layout_width="0dp"
72121
android:layout_height="wrap_content"
73122
android:layout_marginStart="32dp"

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,9 @@
3939
<string name="nav_logout">Ausloggen</string>
4040
<!-- Profilseite -->
4141
<string name="update">Aktualisieren</string>
42+
<!-- Projekt erstellen seite -->
43+
<string name="project_name">Projektname</string>
44+
<string name="project_status">Projektstatus</string>
45+
<string name="create_project_title">Projekt erstellen</string>
46+
<string name="create">ERSTELLEN</string>
4247
</resources>

0 commit comments

Comments
 (0)