Commit c8a3009f authored by 9731301's avatar 9731301

add custom dialog and add SharedPreferencesClass to change the theme

parent 606a8931
package com.example.mynotepad.MenuFeatures.Pics.AddTextToPicDialog;
package com.example.mynotepad.Dialogs.AddTxtToPicsDialog;
import android.app.Activity;
import android.app.Dialog;
......
package com.example.mynotepad.MenuFeatures.Pics.AddTextToPicDialog;
package com.example.mynotepad.Dialogs.AddTxtToPicsDialog;
import android.widget.ImageView;
......
package com.example.mynotepad.Dialogs;
import android.app.Activity;
import android.app.Dialog;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import com.example.mynotepad.R;
public class CustomDialog {
private Button yes, no ;
private TextView textView ;
private onCustomDialogClickListener onCustomDialogClickListener;
public void showAddTxtDialog(Activity activity,String txt) {
final Dialog dialog = new Dialog(activity);
dialog.setCancelable(true);
dialog.setContentView(R.layout.dialog_custom);
yes = dialog.findViewById(R.id.yes);
no = dialog.findViewById(R.id.no);
textView = dialog.findViewById(R.id.textView2);
textView.setText(txt);
addListener(dialog);
dialog.show();
}
private void addListener(final Dialog dialog) {
yes.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onCustomDialogClickListener.yesClicked();
dialog.dismiss();
}
});
no.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onCustomDialogClickListener.noClicked();
dialog.dismiss();
}
});
}
public void setOnCustomDialogClickListener(com.example.mynotepad.Dialogs.onCustomDialogClickListener onCustomDialogClickListener) {
this.onCustomDialogClickListener = onCustomDialogClickListener;
}
}
package com.example.mynotepad.Dialogs;
public interface onCustomDialogClickListener {
void yesClicked();
void noClicked();
}
......@@ -30,12 +30,14 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
private DrawerLayout drawerLayout;
private ImageView theme;
private NavigationView navigationView;
private String themeState = "colored";
private SharedPreferencesClass sharedPreferencesClass;
@Override
protected void onCreate(Bundle savedInstanceState) {
//todo check prefreces and set primitive theme and it is enough to set sTheme
super.onCreate(savedInstanceState);
sharedPreferencesClass = new SharedPreferencesClass();
sharedPreferencesClass.getThemeOnMainActivityCreate(this);
Utils.onActivityCreateThemeForMainActivity(this);
setContentView(R.layout.activity_main);
......@@ -52,13 +54,9 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
case "bright":
drawerLayout.setBackgroundResource(R.drawable.main_bg_bright);
break;
case "colored":
drawerLayout.setBackgroundResource(R.drawable.main_bg_colored);
break;
}
}
private void init() {
noteDataBase = Room.databaseBuilder(this, NoteDataBase.class, "RoomDb").fallbackToDestructiveMigration().allowMainThreadQueries().build();
......@@ -79,18 +77,20 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
View header = navigationView.getHeaderView(0);
theme = header.findViewById(R.id.theme);
// changeThemeToBright();//todo should be set by shared prefrence
if (Utils.sTheme.equals("dark")){
theme.setImageResource(R.drawable.ic_sun);
}else {
theme.setImageResource(R.drawable.ic_night_mode);
}
}
private void addListener() {
theme.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (themeState.equals("bright")) {
if (Utils.sTheme.equals("bright")) {
changeThemeToDark();
} else if (themeState.equals("dark")) {
changeThemeToColored();
} else if (themeState.equals("colored")) {
} else if (Utils.sTheme.equals("dark")) {
changeThemeToBright();
}
}
......@@ -142,24 +142,16 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
private void changeThemeToDark() {
animations(theme);
theme.setImageResource(R.drawable.ic_colored);
Utils.changeToTheme(this, "dark");
themeState = "dark";
sharedPreferencesClass.changeTheTheme(this);
}
private void changeThemeToBright() {
animations(theme);
theme.setImageResource(R.drawable.ic_night_mode);
Utils.changeToTheme(this, "bright");
themeState = "bright";
sharedPreferencesClass.changeTheTheme(this);
}
private void changeThemeToColored() {
Utils.changeToTheme(this, "colored");
animations(theme);
theme.setImageResource(R.drawable.ic_sun);
themeState = "colored";
}
private void animations(ImageView imageView) {
ObjectAnimator alpha = ObjectAnimator.ofFloat(imageView, "alpha", 0f, 1f);
......
......@@ -72,9 +72,6 @@ public class ArchivedNoesListFragment extends Fragment {
case "bright":
allNotesListLayout.setBackgroundResource(R.drawable.main_bg_bright);
break;
case "colored":
allNotesListLayout.setBackgroundResource(R.drawable.main_bg_colored);
break;
}
}
......@@ -162,7 +159,7 @@ public class ArchivedNoesListFragment extends Fragment {
closeClicked(customToolbarOption);
}
});
}
}
private void updateToUnarchiveInDataBase() {
......
......@@ -3,6 +3,7 @@ package com.example.mynotepad.MenuFeatures.AllNotes;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
......@@ -10,12 +11,17 @@ import androidx.navigation.NavController;
import androidx.navigation.Navigation;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
import android.widget.Toast;
import com.example.mynotepad.Dialogs.AddTxtToPicsDialog.AddTextToPicDialog;
import com.example.mynotepad.Dialogs.CustomDialog;
import com.example.mynotepad.Dialogs.onCustomDialogClickListener;
import com.example.mynotepad.MenuFeatures.AllNotes.DataBase.Note;
import com.example.mynotepad.MenuFeatures.AllNotes.MyNoteRecyclerView.MyAllNotesAdaptor;
import com.example.mynotepad.MenuFeatures.AllNotes.MyNoteRecyclerView.MyNote;
......@@ -25,8 +31,10 @@ import com.example.mynotepad.MenuFeatures.CustomToolbarOptionListener;
import com.example.mynotepad.MenuFeatures.Utils;
import com.example.mynotepad.R;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import java.util.ArrayList;
import java.util.List;
import static com.example.mynotepad.MainActivity.noteDataBase;
......@@ -42,6 +50,7 @@ public class AllNotesListFragment extends Fragment {
public static MyNote myChosenNote;
private NavController navController;
private LinearLayout allNotesListLayout;
private CustomDialog customDialog;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
......@@ -67,14 +76,10 @@ public class AllNotesListFragment extends Fragment {
case "bright":
allNotesListLayout.setBackgroundResource(R.drawable.main_bg_bright);
break;
case "colored":
allNotesListLayout.setBackgroundResource(R.drawable.main_bg_colored);
break;
}
}
private void init(View view) {
// get data from database
setAllNoteListAndTitles();
......@@ -86,6 +91,7 @@ public class AllNotesListFragment extends Fragment {
addNoteButton = view.findViewById(R.id.addButton);
navController = Navigation.findNavController(view);
allNotesListLayout = view.findViewById(R.id.allNoteListLayout);
customDialog = new CustomDialog();
// show list with recycler view
recyclerView = view.findViewById(R.id.recyclerView);
......@@ -104,7 +110,6 @@ public class AllNotesListFragment extends Fragment {
showAddAlert();
}
});
// add listener to recyclerView
myAdaptor.setOnItemClickListener(new OnAllNotesItemClickListener() {
@Override
......@@ -114,10 +119,10 @@ public class AllNotesListFragment extends Fragment {
final Bundle bundle = new Bundle();
bundle.putString("title", myNote.getTitle());
bundle.putString("bodyTxt", myNote.getDescription());
bundle.putString("type" , "note");
bundle.putString("type", "note");
//change the fragment
navController.navigate(R.id.action_allNotesListFragment_to_noteFragment ,bundle);
navController.navigate(R.id.action_allNotesListFragment_to_noteFragment, bundle);
}
@Override
......@@ -125,10 +130,9 @@ public class AllNotesListFragment extends Fragment {
customToolbarOption.setVisibility(View.VISIBLE);
allNoteToolBar.setVisibility(View.GONE);
myChosenNote = myNote;
if (myChosenNote.isArchived()){
if (myChosenNote.isArchived()) {
customToolbarOption.setYellowStar();
}
else {
} else {
customToolbarOption.setBlackStar();
}
}
......@@ -155,31 +159,25 @@ public class AllNotesListFragment extends Fragment {
}
protected void closeClicked(CustomToolbarOption customToolbarOption) {
customToolbarOption.setVisibility(View.GONE);
allNoteToolBar.setVisibility(View.VISIBLE);
}
protected void deleteClicked(final Note note) {
AlertDialog.Builder alert = new AlertDialog.Builder(getContext());
alert.setMessage("are you sure you wanna delete it ??? ");
alert.setPositiveButton("yes", new DialogInterface.OnClickListener() {
customDialog.showAddTxtDialog(getActivity(), "are you sure you wanna delete it ??? ");
customDialog.setOnCustomDialogClickListener(new onCustomDialogClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
public void yesClicked() {
noteDataBase.noteDao().deleteNote(note);
myNotes.remove(myChosenNote);
myAdaptor.notifyDataSetChanged();
}
});
alert.setNegativeButton("no", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
dialogInterface.cancel();
public void noClicked() {
}
});
alert.show();
allNoteToolBar.setVisibility(View.VISIBLE);
customToolbarOption.setVisibility(View.GONE);
allNoteToolBar.setVisibility(View.VISIBLE);
......@@ -206,38 +204,31 @@ public class AllNotesListFragment extends Fragment {
private void showAddAlert() {
final AlertDialog.Builder alert = new AlertDialog.Builder(getContext());
alert.setTitle("new note :");
alert.setMessage("Do you want to create a new note ?");
alert.setCancelable(true);
alert.setPositiveButton("yes", new DialogInterface.OnClickListener() {
customDialog.showAddTxtDialog(getActivity(), "Do you want to create a new note ?");
customDialog.setOnCustomDialogClickListener(new onCustomDialogClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
public void yesClicked() {
showABlankNote();
}
});
alert.setNegativeButton("no", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
dialogInterface.cancel();
public void noClicked() {
}
});
alert.show();
}
private void showABlankNote() {
//set noteFragment data
final Bundle bundle = new Bundle();
bundle.putString("title", "");
bundle.putString("bodyTxt","");
bundle.putString("type" , "note");
bundle.putString("bodyTxt", "");
bundle.putString("type", "note");
//change the fragment
navController.navigate(R.id.action_allNotesListFragment_to_noteFragment ,bundle);
navController.navigate(R.id.action_allNotesListFragment_to_noteFragment, bundle);
}
private void setAllNoteListAndTitles() {
entityNotes = noteDataBase.noteDao().getAll();
myNotes = new ArrayList<>();
......
......@@ -14,6 +14,8 @@ import android.view.ViewGroup;
import android.widget.EditText;
import android.widget.Toast;
import com.example.mynotepad.Dialogs.CustomDialog;
import com.example.mynotepad.Dialogs.onCustomDialogClickListener;
import com.example.mynotepad.MenuFeatures.AllArchivedNotes.ArchivedNoesListFragment;
import com.example.mynotepad.MenuFeatures.AllNotes.AllNotesListFragment;
import com.example.mynotepad.MenuFeatures.AllNotes.DataBase.DateEntity;
......@@ -62,7 +64,7 @@ public class NoteFragment extends Fragment {
back.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (titleTxt.getText().length()!=0&&bodyTxt.getText().length()!=0)
if (titleTxt.getText().length() != 0 && bodyTxt.getText().length() != 0)
showAlert();
}
});
......@@ -70,13 +72,11 @@ public class NoteFragment extends Fragment {
private void showAlert() {
final AlertDialog.Builder alert = new AlertDialog.Builder(getContext());
alert.setTitle("new note :");
alert.setMessage("Do you want to save the note ?");
alert.setCancelable(true);
alert.setPositiveButton("yes", new DialogInterface.OnClickListener() {
CustomDialog customDialog = new CustomDialog();
customDialog.showAddTxtDialog(getActivity(), "Do you want to save the note ?");
customDialog.setOnCustomDialogClickListener(new onCustomDialogClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
public void yesClicked() {
if (type.equals("note"))
saveNote();
else if (type.equals("date"))
......@@ -85,26 +85,22 @@ public class NoteFragment extends Fragment {
System.out.println("+++++++++++++++++++++++++++++++++++++++++++++++++++++");
if (noteDateType.equals("note")) {
noteDataBase.noteDao().updateNote(titleTxt.getText().toString(), bodyTxt.getText().toString(), true, ArchivedNoesListFragment.chosenDateOrNote.getId());
} else if (noteDateType.equals("date")){
} else if (noteDateType.equals("date")) {
noteDataBase.dateNoreDAO().updateDate(titleTxt.getText().toString(), bodyTxt.getText().toString(), true, ArchivedNoesListFragment.chosenDateOrNote.getId());
}
}
if (getActivity() != null)
getActivity().onBackPressed();
}
});
alert.setNegativeButton("no", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
dialogInterface.cancel();
public void noClicked() {
getActivity().onBackPressed();
}
});
alert.show();
}
private void saveNote() {
if (isAnewNote) {
note = new Note(titleTxt.getText().toString(), bodyTxt.getText().toString(), false);
......@@ -133,11 +129,10 @@ public class NoteFragment extends Fragment {
Bundle bundle = getArguments();
if (bundle != null)
if (bundle.getString("title").equals("") && bundle.getString("bodyTxt").equals("")){
if (bundle.getString("title").equals("") && bundle.getString("bodyTxt").equals("")) {
isAnewNote = true;
type = bundle.getString("type");
}
else {
} else {
isAnewNote = false;
titleTxt.setText(bundle.getString("title"));
bodyTxt.setText(bundle.getString("bodyTxt"));
......
......@@ -12,12 +12,14 @@ import androidx.navigation.NavController;
import androidx.navigation.Navigation;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
import android.widget.Toast;
import com.example.mynotepad.MenuFeatures.AllNotes.DataBase.DateEntity;
import com.example.mynotepad.MenuFeatures.Calender.MyCalenderRecyclerView.MyCalenderAdaptor;
import com.example.mynotepad.MenuFeatures.Calender.MyCalenderRecyclerView.OnCalenderItemClickListener;
......@@ -27,6 +29,7 @@ import com.example.mynotepad.MenuFeatures.CustomToolbarOptionListener;
import com.example.mynotepad.MenuFeatures.Utils;
import com.example.mynotepad.R;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import java.util.ArrayList;
import java.util.List;
......@@ -79,9 +82,6 @@ public class CalenderNotesListFragment extends Fragment {
case "bright":
allNotesListLayout.setBackgroundResource(R.drawable.main_bg_bright);
break;
case "colored":
allNotesListLayout.setBackgroundResource(R.drawable.main_bg_colored);
break;
}
}
......@@ -112,7 +112,7 @@ public class CalenderNotesListFragment extends Fragment {
addDateBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
navController.navigate(R.id.action_calenderNotesListFragment_to_timePickerFragment );
navController.navigate(R.id.action_calenderNotesListFragment_to_timePickerFragment);
}
});
......@@ -125,9 +125,9 @@ public class CalenderNotesListFragment extends Fragment {
final Bundle bundle = new Bundle();
bundle.putString("title", myChosenDateNote.getDate());
bundle.putString("bodyTxt", myChosenDateNote.getDescription());
bundle.putString("type","date");
bundle.putString("type", "date");
//change the fragment
navController.navigate(R.id.action_calenderNotesListFragment_to_noteFragment2 ,bundle);
navController.navigate(R.id.action_calenderNotesListFragment_to_noteFragment2, bundle);
}
@Override
......
......@@ -14,11 +14,10 @@ import android.provider.MediaStore;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import com.example.mynotepad.MenuFeatures.Pics.AddTextToPicDialog.AddTextToPicDialog;
import com.example.mynotepad.MenuFeatures.Pics.AddTextToPicDialog.OnSavePicListenerClick;
import com.example.mynotepad.Dialogs.AddTxtToPicsDialog.AddTextToPicDialog;
import com.example.mynotepad.Dialogs.AddTxtToPicsDialog.OnSavePicListenerClick;
import com.example.mynotepad.MenuFeatures.Pics.Camera.CameraActivity;
import com.example.mynotepad.MenuFeatures.Utils;
import com.example.mynotepad.R;
......@@ -31,7 +30,7 @@ public class ChoosingPicsFragment extends Fragment {
private LinearLayout camera, gallery;
private String newFilePath;
private ConstraintLayout constraintLayout ;
private ConstraintLayout constraintLayout;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
......@@ -57,11 +56,9 @@ public class ChoosingPicsFragment extends Fragment {
case "bright":
constraintLayout.setBackgroundResource(R.drawable.main_bg_bright);
break;
case "colored":
constraintLayout.setBackgroundResource(R.drawable.main_bg_colored);
break;
}
}
private void init(View view) {
camera = view.findViewById(R.id.cameraBtn);
gallery = view.findViewById(R.id.galleryBtn);
......@@ -115,7 +112,7 @@ public class ChoosingPicsFragment extends Fragment {
private void showDialogOnResult(final Bitmap bitmap) {
//show dialog to save pic with note
AddTextToPicDialog addTextToPicDialog = new AddTextToPicDialog();
addTextToPicDialog.showAddTxtDialog(getActivity() , bitmap);
addTextToPicDialog.showAddTxtDialog(getActivity(), bitmap);
addTextToPicDialog.setOnSavePicListenerClick(new OnSavePicListenerClick() {
@Override
public void saveClicked(String editTextTxt) {
......
package com.example.mynotepad.MenuFeatures.Pics;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.net.Uri;
import android.os.Bundle;
import androidx.annotation.NonNull;
......@@ -13,16 +9,9 @@ import androidx.fragment.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import com.example.mynotepad.MenuFeatures.Pics.AddTextToPicDialog.AddTextToPicDialog;
import com.example.mynotepad.MenuFeatures.Pics.AddTextToPicDialog.OnSavePicListenerClick;
import com.example.mynotepad.R;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.InputStream;
public class NotedPicsListFragment extends Fragment {
......
......@@ -9,7 +9,7 @@ import androidx.appcompat.app.ActionBar;
import com.example.mynotepad.R;
public class Utils {
public static String sTheme ="colored";
public static String sTheme = "colored";
/**
* Set the theme of the Activity, and restart it by creating a new Activity of the same type.
......@@ -36,11 +36,6 @@ public class Utils {
supportActionBar.setBackgroundDrawable(new ColorDrawable(activity.getResources().getColor(R.color.colorPrimary)));
break;
}
case "colored": {
activity.setTheme(R.style.AppThemeColored);
supportActionBar.setBackgroundDrawable(new ColorDrawable(activity.getResources().getColor(R.color.colorPrimary3)));
break;
}
}
}
......@@ -54,10 +49,6 @@ public class Utils {
activity.setTheme(R.style.AppThemeNoActionBArBright);
break;
}
case "colored": {
activity.setTheme(R.style.AppThemeColored);
break;
}
}
}
}
......@@ -24,8 +24,10 @@ import android.view.ViewGroup;
import android.widget.Chronometer;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.Toast;
import com.example.mynotepad.MenuFeatures.Utils;
import com.example.mynotepad.R;
import java.io.File;
......@@ -45,6 +47,7 @@ public class RecordFragment extends Fragment implements View.OnClickListener {
private String fileName = null;
private Chronometer chronometer;
private int RECORD_AUDIO_REQUEST_CODE = 123;
private RelativeLayout layout;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
......@@ -60,6 +63,18 @@ public class RecordFragment extends Fragment implements View.OnClickListener {
getPermissionToRecordAudio();
}
init(view);
setBg(Utils.sTheme);
}
private void setBg(String sTheme) {
switch (sTheme) {
case "dark":
layout.setBackgroundResource(R.drawable.main_bg_dark);
break;
case "bright":
layout.setBackgroundResource(R.drawable.main_bg_bright);
break;
}
}
@RequiresApi(api = Build.VERSION_CODES.M)
......@@ -91,6 +106,7 @@ public class RecordFragment extends Fragment implements View.OnClickListener {
listBtn = view.findViewById(R.id.recordList);
recordBtn = view.findViewById(R.id.recordBtn);
chronometer = view.findViewById(R.id.chronometerTimer);
layout = view.findViewById(R.id.layout);
listBtn.setOnClickListener(this);
recordBtn.setOnClickListener(this);
......
package com.example.mynotepad;
import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;
import com.example.mynotepad.MenuFeatures.Utils;
public class SharedPreferencesClass {
private SharedPreferences sharedPreferences;
private SharedPreferences.Editor editor;
public void changeTheTheme( Activity activity) {
sharedPreferences = activity.getPreferences(Context.MODE_PRIVATE);
editor = sharedPreferences.edit();
editor.putString(activity.getString(R.string.saved_high_score_key), Utils.sTheme).apply();
}
public void getThemeOnMainActivityCreate(Activity activity){
SharedPreferences sharedPref = activity.getPreferences(Context.MODE_PRIVATE);
Utils.sTheme = sharedPref.getString( activity.getString(R.string.saved_high_score_key) , "bright");
}
}
......@@ -3,7 +3,15 @@
<corners
android:radius="27dp"
/>
<solid android:color="?colorSecondary"/>
<gradient
android:startColor="?colorSecondary"
android:endColor="?colorOnSecondary"
android:type="linear"
android:angle="45"
/>
<size
android:width="120dp"
android:height="54dp" />
<size
android:width="190dp"
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners
android:radius="27dp"
/>
<solid android:color="?colorSecondary"/>
<corners android:radius="27dp" />
<gradient
android:startColor="?colorSecondary"
android:endColor="?colorOnSecondary"
android:type="linear"
android:angle="45"
/>
<size
android:width="120dp"
android:height="54dp"
/>
android:height="54dp" />
</shape>
\ No newline at end of file
......@@ -3,7 +3,7 @@
<corners
android:radius="27dp"
/>
<solid android:color="?colorSecondary"/>
<size
android:width="54dp"
android:height="54dp"
......
......@@ -2,7 +2,7 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape>
<solid android:color="?colorPrimaryDark" />
<solid android:color="?background"/>
<corners android:radius="0dp" />
</shape>
</item>
......
......@@ -2,11 +2,8 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:startColor="?colorSecondary"
android:endColor="?colorSecondary"
android:type="radial"
android:gradientRadius="500dp"/>
<solid android:color="?colorOnPrimary"/>
<stroke
android:width="20dp"
android:color="#16A0B9FC"/>
......
......@@ -49,9 +49,10 @@
android:orientation="horizontal">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/bg_button2"
android:layout_width="120dp"
android:layout_height="54dp"
android:width="120dp"
android:height="54dp"
android:gravity="center"
android:onClick="allNoteClicked"
android:text="@string/all_notes" />
......@@ -75,9 +76,8 @@
android:orientation="horizontal">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/bg_button2"
android:layout_width="120dp"
android:layout_height="54dp"
android:gravity="center"
android:onClick="onCalendarClicked"
android:text="@string/calendar"
......@@ -105,9 +105,8 @@
android:orientation="horizontal">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/bg_button2"
android:layout_width="120dp"
android:layout_height="54dp"
android:gravity="center"
android:onClick="onVoiceMassagesClicked"
android:text="@string/voice_massages" />
......@@ -132,9 +131,8 @@
<TextView
android:id="@+id/button8"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/bg_button2"
android:layout_width="120dp"
android:layout_height="54dp"
android:gravity="center"
android:onClick="noNotedPicsClicked"
android:text="@string/noted_pics"
......@@ -163,9 +161,8 @@
<TextView
android:id="@+id/program"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/bg_button2"
android:layout_width="120dp"
android:layout_height="54dp"
android:gravity="center"
android:onClick="onProgramsClicked"
android:text="@string/programs"
......@@ -193,7 +190,7 @@
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:background="?colorSecondaryVariant"
android:background="?itemBackground"
android:fitsSystemWindows="true"
app:headerLayout="@layout/menu_header"
app:menu="@menu/drawer_menu" />
......
......@@ -2,10 +2,9 @@
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#CBE3F6">
android:background="?colorButtonNormal">
<ImageView
android:id="@+id/imageView"
......
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="280dp"
android:layout_height="160dp"
android:background="?colorButtonNormal">
<Button
android:id="@+id/yes"
android:layout_width="60dp"
android:layout_height="40dp"
android:layout_marginEnd="32dp"
android:layout_marginRight="32dp"
android:background="@drawable/bg_button"
android:text="yes"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView2" />
<Button
android:id="@+id/no"
android:layout_width="60dp"
android:layout_height="40dp"
android:layout_marginStart="32dp"
android:layout_marginLeft="32dp"
android:background="@drawable/bg_button"
android:text="no"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView2" />
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="32dp"
android:text="TextView"
android:textColor="?colorSecondary"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
......@@ -25,10 +25,9 @@
android:orientation="horizontal">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_width="120dp"
android:layout_height="54dp"
android:text="@string/camera"
android:background="@drawable/bg_button2"
android:gravity="center"
android:textSize="20dp"/>
......@@ -48,9 +47,8 @@
android:id="@+id/galleryBtn">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/bg_button2"
android:layout_width="120dp"
android:layout_height="54dp"
android:gravity="center"
android:text="@string/gallery"
android:textSize="20dp"/>
......
......@@ -52,5 +52,7 @@
android:src="@drawable/ic_baseline_keyboard_backspace_24"
app:backgroundTint="?colorError"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
app:layout_constraintEnd_toEndOf="parent"
android:tint="?android:textColor"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/layout"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MenuFeatures.VoiceMassages.RecordFragment"
android:background="?colorButtonNormal">
android:background="@drawable/main_bg_bright">
<ImageView
android:id="@+id/img"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="60dp"
android:src="@drawable/pic_stones" />
<LinearLayout
android:id="@+id/linearLayoutRecorder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/img"
android:layout_alignParentTop="true"
android:layout_marginTop="127dp"
android:orientation="vertical">
<ImageView
......@@ -46,12 +39,12 @@
android:id="@+id/recordBtn"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_alignParentBottom="true"
android:layout_below="@+id/linearLayoutRecorder"
android:layout_centerHorizontal="true"
android:layout_marginBottom="50dp"
android:layout_marginTop="95dp"
android:background="@drawable/start_stop_bg"
android:src="@drawable/ic_record"
app:tint="@color/black"/>
app:tint="@color/black" />
<ImageView
......
......@@ -66,7 +66,7 @@
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/player_bg"
android:background="@drawable/bg_player"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
......
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#457FAE</color>
<color name="colorPrimaryDark">#3A478C</color>
<color name="colorAccent">#2980b9</color>
<color name="colorPrimary">#B4A3D8</color>
<color name="colorPrimaryDark">#9685B8</color>
<color name="colorAccent">#9685B8</color>
<color name="colorButtonTxt">#FFFFFF</color>
<color name="colorBtn">#2980b9</color>
<color name="colorDrawer">#e3f2fb</color>
<color name="colorHeader">#F57AA0B5</color>
<color name="mediaHeader">#30336b</color>
<color name="floatingButton">#f5c7c5</color>
<color name="background">#607AA0B5</color>
<color name="colorBtn">#8e44ad</color>
<color name="colorBtnGradient">#E2A4FF</color>
<color name="colorDrawer">#FCF3FF</color>
<color name="colorHeader">#B4A3D8</color>
<color name="mediaHeader">#8e44ad</color>
<color name="floatingButton">#E196D0</color>
<color name="background">#FCF3FF</color>
<color name="item_bg_color">#8676A5</color>
<color name="colorPrimary2">#242424</color>
<color name="colorPrimaryDark2">#4A4A4A</color>
<color name="colorAccent2">#ffda79</color>
<color name="colorButtonTxt2">#FFFFFF</color>
<color name="colorBtn2">#f2dbb2</color>
<color name="colorDrawer2">#1b1b1b</color>
<color name="colorDrawer2">#232323</color>
<color name="colorHeader2">#ffda79</color>
<color name="mediaHeader2">#f0932b</color>
<color name="floatingButton2">#efefef</color>
<color name="background2">#2f2f2f</color>
<color name="colorPrimary3">#ff9da2</color>
<color name="colorPrimaryDark3">#808e9b</color>
<color name="colorAccent3">#ffda79</color>
<color name="colorButtonTxt3">#ff6348</color>
<color name="colorBtn3">#808e9b</color>
<color name="colorDrawer3">#F6D2D0</color>
<color name="colorHeader3">#C39F9E</color>
<color name="mediaHeader3">#C39F9E</color>
<color name="floatingButton3">#ff9da2</color>
<color name="background3">#F3DEDE</color>
</resources>
\ No newline at end of file
......@@ -27,4 +27,5 @@
<string name="navigation_drawer_close">close</string>
<string name="back">back</string>
<string name="save">save</string>
<string name="saved_high_score_key" />
</resources>
\ No newline at end of file
......@@ -6,12 +6,16 @@
<item name="colorPrimaryDark">@color/colorPrimaryDark2</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="colorSecondary">@color/colorBtn</item>
<item name="colorOnSecondary">@color/colorBtnGradient</item>
<item name="android:textColor">@color/white</item>
<item name="android:textColorPrimary">@color/black</item>
<item name="colorSecondaryVariant">@color/colorDrawer</item>
<item name="colorSurface">@color/colorHeader</item>
<item name="android:textColorTertiary">@color/mediaHeader</item>
<item name="android:textColorTertiary">@color/colorBtn</item>
<item name="colorError">@color/floatingButton</item>
<item name="colorButtonNormal">@color/colorDrawer</item>
<item name="colorOnPrimary">@color/item_bg_color</item>
<item name="colorBackgroundFloating">@color/colorPrimaryDark</item>
</style>
<!-- bright application theme. -->
......@@ -23,13 +27,17 @@
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="colorSecondary">@color/colorBtn</item>
<item name="colorOnSecondary">@color/colorBtnGradient</item>
<item name="android:textColor">@color/white</item>
<item name="android:textColorPrimary">@color/black</item>
<item name="colorSecondaryVariant">@color/colorDrawer</item>
<item name="itemBackground">@color/colorDrawer</item>
<item name="colorSurface">@color/colorHeader</item>
<item name="android:textColorTertiary">@color/mediaHeader</item>
<item name="android:textColorTertiary">@color/colorBtn</item>
<item name="colorError">@color/floatingButton</item>
<item name="colorButtonNormal">@color/background</item>
<item name="colorOnPrimary">@color/item_bg_color</item>
<item name="colorBackgroundFloating">@color/colorPrimaryDark</item>
</style>
<!-- dark application theme. -->
......@@ -39,28 +47,18 @@
<item name="colorPrimaryDark">@color/colorPrimaryDark2</item>
<item name="colorAccent">@color/colorAccent2</item>
<item name="colorSecondary">@color/colorBtn2</item>
<item name="colorOnSecondary">@color/colorBtn2</item>
<item name="android:textColor">@color/black</item>
<item name="android:textColorPrimary">@color/white</item>
<item name="colorSecondaryVariant">@color/colorDrawer2</item>
<item name="itemBackground">@color/colorDrawer2</item>
<item name="colorSurface">@color/colorHeader2</item>
<item name="android:textColorTertiary">@color/mediaHeader2</item>
<item name="colorError">@color/floatingButton2</item>
<item name="colorButtonNormal">@color/background2</item>
<item name="colorOnPrimary">@color/colorBtn2</item>
<item name="colorBackgroundFloating">@color/background</item>
</style>
<style name="AppThemeColored">
<item name="colorPrimary">@color/colorPrimary3</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark3</item>
<item name="colorAccent">@color/colorAccent3</item>
<item name="colorSecondary">@color/colorBtn3</item>
<item name="android:textColor">@color/white</item>
<item name="android:textColorPrimary">@color/black</item>
<item name="colorSecondaryVariant">@color/colorDrawer3</item>
<item name="colorSurface">@color/colorHeader3</item>
<item name="android:textColorTertiary">@color/mediaHeader3</item>
<item name="colorError">@color/floatingButton3</item>
<item name="colorButtonNormal">@color/background3</item>
</style>
</resources>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment