Skip to content

Commit

Permalink
Fully Completed
Browse files Browse the repository at this point in the history
  • Loading branch information
techinessoverloaded committed Jun 21, 2021
1 parent 6402386 commit 9bc4e98
Show file tree
Hide file tree
Showing 11 changed files with 277 additions and 190 deletions.
334 changes: 176 additions & 158 deletions app/src/main/java/com/apjdminiproj/proton/Activities/MainActivity.java

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ public class ChatAdapter extends RecyclerView.Adapter<ChatAdapter.ViewHolder>
{
public static final int MSG_TYPE_LEFT=0;
public static final int MSG_TYPE_RIGHT=1;
private Context mContext;
private List<Chat> messages;
private Animation bounceAnimation;
private final Context mContext;
private final List<Chat> messages;
private final Animation bounceAnimation;
public ChatAdapter(Context context,List<Chat> msgs)
{
mContext=context;
Expand All @@ -36,12 +36,12 @@ public ChatAdapter.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int
if(viewType==MSG_TYPE_RIGHT)
{
View view = LayoutInflater.from(mContext).inflate(R.layout.chat_item_right,parent,false);
return new ChatAdapter.ViewHolder(view);
return new ViewHolder(view);
}
else
{
View view = LayoutInflater.from(mContext).inflate(R.layout.chat_item_left,parent,false);
return new ChatAdapter.ViewHolder(view);
return new ViewHolder(view);
}
}

Expand Down Expand Up @@ -90,10 +90,10 @@ public int getItemViewType(int position)
return messages.get(position).getMessageType();
}

public class ViewHolder extends RecyclerView.ViewHolder
public static class ViewHolder extends RecyclerView.ViewHolder
{
private TextView showMessageLeft;
private TextView showMessageRight;
private final TextView showMessageLeft;
private final TextView showMessageRight;
public ViewHolder(@NonNull View itemView)
{
super(itemView);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
package com.apjdminiproj.proton.Helpers;

import android.content.Context;
import android.content.SharedPreferences;
import androidx.preference.PreferenceManager;
Expand All @@ -12,6 +13,7 @@ public class PreferenceUtils
private static SharedPreferences sharedPreferences;
private static SharedPreferences.Editor editor;
private static final String chatListKey="chat_backup";
private static final String isFirstTimeKey="is_first_time";
private static PreferenceUtils instance=null;
private PreferenceUtils(Context context)
{
Expand Down Expand Up @@ -48,4 +50,14 @@ public void setChatList(ArrayList<Chat> value)
editor.putString(chatListKey,json);
editor.apply();
}
public boolean getIsFirstTime()
{
return sharedPreferences.getBoolean(isFirstTimeKey,true);
}
public void setIsFirstTime(boolean value)
{
editor=sharedPreferences.edit();
editor.putBoolean(isFirstTimeKey,value);
editor.apply();
}
}
10 changes: 0 additions & 10 deletions app/src/main/res/drawable/ic_kboard.xml

This file was deleted.

3 changes: 1 addition & 2 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,9 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
android:background="@color/white"
android:background="@color/white_slight_dark"
android:padding="12dp"
app:elevation="2dp"
android:visibility="visible"
>
<LinearLayout
android:layout_width="0dp"
Expand Down
25 changes: 23 additions & 2 deletions app/src/main/res/values-night/strings.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="UTF-8" ?>
<resources>
<string name="type_a_command">Type a Command</string>
<string name="app_name">Proton</string>
<string name="type_a_command">Type/Speak something</string>
<string name="sample">Sample</string>
<string name="you"><b>You</b></string>
<string name="proton"><b>Proton</b></string>
<string name="listening_to_you">Listening to you…</string>
<string name="cancel">Cancel</string>
<string name="help">Hello Protonite ! This is how I can help you :
\n1. You can call anyone by using this command prefix : Call this Number
\n2. You can search anything on Google by using this command prefix : Google this
\n3. You can play any song/video on YouTube by using this command prefix : Play this
\n4. You can send an SMS to anyone by using this command prefix : Ping
\n5. You can take a Selfie by using this command : Take A Selfie
\n6. You can take a Picture by using this command : Take A Picture
\n7. You can turn FlashLight ON/OFF using this command : Turn ON/OFF FlashLight
\n8. You can Increase/Decrease Brightness using this command : Increase/Decrease Brightness
\n9. You can Set/Delete an Alarm using this command : Set/Delete An Alarm
\n10. You can the Phone Settings using this command : Open Phone Settings
\n11. You can view this Help List again by asking me to Help You
\nYou can also have short and simple conversations with me.
\nHappy Protoning !
</string>
</resources>
14 changes: 11 additions & 3 deletions app/src/main/res/values-night/themes.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Theme.Proton" parent="Theme.MaterialComponents.DayNight.NoActionBar">
<!-- Primary brand color. -->
<item name="colorPrimary">@color/black_light</item>
<item name="colorPrimaryVariant">@color/black</item>
<item name="colorOnPrimary">@color/white</item>
<item name="colorPrimary">@color/white</item>
<item name="colorPrimaryVariant">@color/white_dark</item>
<item name="colorOnPrimary">@color/black</item>
<!-- Secondary brand color. -->
<item name="colorSecondary">@color/t_blue</item>
<item name="colorSecondaryVariant">@color/t_blue_dark</item>
Expand All @@ -13,4 +14,11 @@
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
<!-- Customize your theme here. -->
</style>
<style name="AlertDialogTheme" parent="Theme.MaterialComponents.DayNight.Dialog.Alert">
<item name="colorPrimary">@color/t_blue_dark</item>
</style>
<style name="TimePickerDialogTheme" parent="Theme.AppCompat.Light.Dialog">
<item name="android:textColor">@color/t_blue_dark</item>
<item name="colorAccent">@color/t_blue_dark</item>
</style>
</resources>
27 changes: 27 additions & 0 deletions app/src/main/res/values/arrays.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="conversations">
<item>I am fine. I am sure that you\'re doing well too !</item>
<item>I am doing well. I am always there to help you.</item>
<item>I am fine as long as I am able to help you.</item>
<item>I love being your Assistant !</item>
<item>I am here only for you !</item>
<item>Glad that you like me and my Service !</item>
<item>Have a Nice Protonic Day !</item>
<item>Good Day, Dear Protonite !</item>
<item>Have a Nice Protonic Morning !</item>
<item>Good Morning, Dear Protonite !</item>
<item>Have a Nice Protonic Afternoon !</item>
<item>Good Afternoon, Dear Protonite !</item>
<item>Have a Nice Protonic Evening !</item>
<item>Good Evening, Dear Protonite !</item>
<item>Have Sweet Protonic Dreams!</item>
<item>Good Night, Dear Protonite ! Don\'t forget to set an Alarm using Proton !</item>
<item>Good Bye, Dear Protonite ! Waiting to help you again ! Closing the App now !</item>
<item>Good Bye ! Let\'s meet again soon ! Closing the App now !</item>
<item>I was created by :
\n1. Arunprasadh C
\n2. Joseph Daniel C</item>
<item>@string/help</item>
</string-array>
</resources>
9 changes: 2 additions & 7 deletions app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="purple_200">#FFBB86FC</color>
<color name="purple_500">#FF6200EE</color>
<color name="purple_700">#FF3700B3</color>
<color name="teal_200">#FF03DAC5</color>
<color name="teal_700">#FF018786</color>
<color name="black">#000000</color>
<color name="black_light">#2c2c2c</color>
<color name="white">#FFFFFF</color>
<color name="white_dark">#c0c0c0</color>
<color name="white_slight_dark">#fafafa</color>
<color name="white_dark">#d4d4d4</color>
<color name="t_blue">#1383ff</color>
<color name="t_blue_dark">#0057cb</color>
<color name="t_blue_light">#6db2ff</color>
</resources>
16 changes: 16 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?>
<resources>
<string name="app_name">Proton</string>
<string name="type_a_command">Type/Speak something</string>
Expand All @@ -6,4 +7,19 @@
<string name="proton"><b>Proton</b></string>
<string name="listening_to_you">Listening to you…</string>
<string name="cancel">Cancel</string>
<string name="help">Hello Protonite ! This is how I can help you :
\n1. You can call anyone by using this command prefix : Call this Number
\n2. You can search anything on Google by using this command prefix : Google this
\n3. You can play any song/video on YouTube by using this command prefix : Play this
\n4. You can send an SMS to anyone by using this command prefix : Ping
\n5. You can take a Selfie by using this command : Take A Selfie
\n6. You can take a Picture by using this command : Take A Picture
\n7. You can turn FlashLight ON/OFF using this command : Turn ON/OFF FlashLight
\n8. You can Increase/Decrease Brightness using this command : Increase/Decrease Brightness
\n9. You can Set/Delete an Alarm using this command : Set/Delete An Alarm
\n10. You can the Phone Settings using this command : Open Phone Settings
\n11. You can view this Help List again by asking me to Help You
\nYou can also have short and simple conversations with me.
\nHappy Protoning !
</string>
</resources>
1 change: 1 addition & 0 deletions app/src/main/res/values/themes.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?>
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Theme.Proton" parent="Theme.MaterialComponents.DayNight.NoActionBar">
Expand Down

0 comments on commit 9bc4e98

Please sign in to comment.