Skip to content

Commit

Permalink
Fix most of the layouts [In progress]
Browse files Browse the repository at this point in the history
  • Loading branch information
ElectroBoy404NotFound committed Mar 31, 2023
1 parent 9b1ee23 commit ab8bc67
Show file tree
Hide file tree
Showing 14 changed files with 119 additions and 106 deletions.
24 changes: 21 additions & 3 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,36 +7,52 @@
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:supportsRtl="false"
android:screenOrientation = "portrait"
android:theme="@style/Theme.YAPCA">
<activity
android:name=".ui.chat.OpenNewChatScreen"
android:configChanges="orientation"
android:screenOrientation="portrait"
android:exported="false" />
<activity
android:name=".ui.chat.CreateRoomScreen"
android:configChanges="orientation"
android:screenOrientation="portrait"
android:exported="false" />
<activity
android:name=".ui.chat.ChatLoginScreen"
android:configChanges="orientation"
android:screenOrientation="portrait"
android:exported="true"
android:theme="@style/Theme.YAPCA.NoActionBar" />
<activity
android:name=".ui.splash.ChatScreenSplashScreen"
android:configChanges="orientation"
android:screenOrientation="portrait"
android:exported="true"
android:theme="@style/Theme.YAPCA.NoActionBar" />
<activity
android:name=".ui.chat.ChatScreen"
android:configChanges="orientation"
android:screenOrientation="portrait"
android:exported="true"
android:resizeableActivity="true"
android:theme="@style/Theme.YAPCA.NoActionBar"
tools:targetApi="24" />
<activity
android:name=".ui.chat.ChatSelectScreen"
android:configChanges="orientation"
android:screenOrientation="portrait"
android:exported="false" />
<activity
android:name=".ui.splash.ChatAppSplashScreen"
android:configChanges="orientation"
android:screenOrientation="portrait"
android:exported="false" />
<activity
android:name=".ui.splash.SplashScreen"
android:configChanges="orientation"
android:screenOrientation="portrait"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand All @@ -46,7 +62,9 @@
</activity>
<activity
android:name=".ui.login.LoginActivity"
android:exported="true" />
android:exported="true"
android:configChanges="orientation"
android:screenOrientation="portrait"/>
</application>

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public void afterTextChanged(Editable s) {
while(password.length() < 16)
password.append('0');
if(Crypto.getSHA256(password.toString()).equals(keys.get(TempStorage.get("OPEN_CHAT")))){
TempStorage.addOrSet("CT_CP", ((EditText)findViewById(R.id.editTextTextPassword)).getText().toString());
TempStorage.addOrSet("CT_CP", password.toString());
startActivity(new Intent(ChatLoginScreen.this, ChatScreenSplashScreen.class));
}else Toast.makeText(ChatLoginScreen.this, "Incorrect Password!", Toast.LENGTH_SHORT).show();
} catch (NoSuchAlgorithmException ex) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,18 @@ public void onCancelled(@NonNull DatabaseError error) {
// Failed to read value
// Toast.makeText(LoginActivity.this, "ERROR!\n" + error.toException().getMessage(), Toast.LENGTH_LONG).show();
Log.w(null,"Failed to read value.", error.toException());
((TextView) findViewById(R.id.status)).setText("Oh no! Connect to the internet and restart the app to continue!");
// ((TextView) findViewById(R.id.status)).setText("Oh no! Connect to the internet and restart the app to continue!");
}
};
myRef.addValueEventListener(vel);
adapter.notifyDataSetChanged();
((Button) findViewById(R.id.sendtxt)).setOnClickListener((v) -> {
HashMap<String, String> data2 = new HashMap<>();
System.out.println((String) TempStorage.get("USERNAME"));
System.out.println((String) TempStorage.get("CT_CP"));
System.out.println(((EditText)findViewById(R.id.messagesend)).getText().toString());
System.out.println(Crypto.encrypt((String) TempStorage.get("USERNAME"), (String) TempStorage.get("CT_CP")));
System.out.println(Crypto.encrypt(((EditText)findViewById(R.id.messagesend)).getText().toString(), (String) TempStorage.get("CT_CP")));
data2.put("user", Crypto.encrypt((String) TempStorage.get("USERNAME"), (String) TempStorage.get("CT_CP")));
data2.put("msg", Crypto.encrypt(((EditText)findViewById(R.id.messagesend)).getText().toString(), (String) TempStorage.get("CT_CP")));
myRef.push().setValue(data2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
@Override
public void onCancelled(@NonNull DatabaseError error) {
Log.w(null, "Failed to read value.", error.toException());
((TextView) findViewById(R.id.status)).setText("Oh no! Connect to the internet and restart the app to continue!");
// ((TextView) findViewById(R.id.status)).setText("Oh no! Connect to the internet and restart the app to continue!");
}
});
}

@Override
public void onCancelled(@NonNull DatabaseError error) {
Log.w(null, "Failed to read value.", error.toException());
((TextView) findViewById(R.id.status)).setText("Oh no! Connect to the internet and restart the app to continue!");
// ((TextView) findViewById(R.id.status)).setText("Oh no! Connect to the internet and restart the app to continue!");
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public void onCancelled(@NonNull DatabaseError error) {
// Failed to read value
// Toast.makeText(LoginActivity.this, "ERROR!\n" + error.toException().getMessage(), Toast.LENGTH_LONG).show();
Log.w(null,"Failed to read value.", error.toException());
((TextView) findViewById(R.id.status)).setText("Oh no! Connect to the internet and restart the app to continue!");
// ((TextView) findViewById(R.id.status)).setText("Oh no! Connect to the internet and restart the app to continue!");
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public void onCancelled(@NonNull DatabaseError error) {
// Failed to read value
// Toast.makeText(LoginActivity.this, "ERROR!\n" + error.toException().getMessage(), Toast.LENGTH_LONG).show();
Log.w(null,"Failed to read value.", error.toException());
((TextView) findViewById(R.id.status)).setText("Oh no! Connect to the internet and restart the app to continue!");
// ((TextView) findViewById(R.ids.status)).setText("Oh no! Connect to the internet and restart the app to continue!");
}
});
}
Expand Down
17 changes: 8 additions & 9 deletions app/src/main/res/layout/activity_chat_app_splah_screen.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,27 @@
android:id="@+id/textView6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="236dp"
android:text="Yet Another Private Chat App"
android:text="@string/app_name_full"
android:textSize="18sp"
app:layout_constraintBottom_toTopOf="@+id/imageView"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.497"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView7"
app:layout_constraintVertical_bias="0.626" />

<TextView
android:id="@+id/textView7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="YAPCA"
android:text="@string/app_name"
android:textSize="28sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.498"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.275" />
app:layout_constraintVertical_bias="0.082" />

<TextView
android:id="@+id/textView"
Expand All @@ -43,8 +42,8 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.498"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.441" />
app:layout_constraintTop_toBottomOf="@+id/textView6"
app:layout_constraintVertical_bias="0.339" />

<ProgressBar
android:id="@+id/progressBar2"
Expand All @@ -55,6 +54,6 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.498"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.528" />
app:layout_constraintTop_toBottomOf="@+id/textView"
app:layout_constraintVertical_bias="0.093" />
</androidx.constraintlayout.widget.ConstraintLayout>
30 changes: 16 additions & 14 deletions app/src/main/res/layout/activity_chat_login_screen.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,26 @@
android:layout_height="wrap_content"
android:text="YAPCA"
android:textSize="28sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintBottom_toTopOf="@+id/textView14"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.498"
app:layout_constraintHorizontal_bias="0.489"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.023" />
app:layout_constraintVertical_bias="1.0" />

<TextView
android:id="@+id/textView14"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="56dp"
android:layout_marginTop="60sp"
android:text="Yet Another Private Chat App"
android:textSize="18sp"
app:layout_constraintBottom_toTopOf="@+id/text123"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.502"
app:layout_constraintHorizontal_bias="0.497"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.055" />

<Button
android:id="@+id/buttoncreate"
Expand All @@ -41,32 +43,32 @@
app:layout_constraintHorizontal_bias="0.504"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.465" />
app:layout_constraintVertical_bias="0.453" />

<TextView
android:id="@+id/text123"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Login For Error"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintBottom_toTopOf="@+id/editTextTextPassword"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.498"
app:layout_constraintHorizontal_bias="0.496"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.193" />
app:layout_constraintVertical_bias="0.669" />

<EditText
android:id="@+id/editTextTextPassword"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="textPassword"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintBottom_toTopOf="@+id/buttoncreate"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.497"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.298" />
app:layout_constraintVertical_bias="0.92" />

<Button
android:id="@+id/buttonback"
Expand All @@ -77,6 +79,6 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.504"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.576" />
app:layout_constraintTop_toBottomOf="@+id/buttoncreate"
app:layout_constraintVertical_bias="0.037" />
</androidx.constraintlayout.widget.ConstraintLayout>
22 changes: 11 additions & 11 deletions app/src/main/res/layout/activity_chat_screen.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
android:id="@+id/textView13"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="56dp"
android:layout_marginTop="56sp"
android:text="Yet Another Private Chat App"
android:textSize="18sp"
app:layout_constraintEnd_toEndOf="parent"
Expand All @@ -35,19 +35,19 @@

<ListView
android:id="@+id/chat"
android:layout_width="404dp"
android:layout_height="523dp"
android:layout_marginStart="4dp"
android:layout_width="fill_parent"
android:layout_height="500sp"
android:layout_marginStart="16dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.25" />
app:layout_constraintVertical_bias="0.296" />

<EditText
android:id="@+id/messagesend"
android:layout_width="400dp"
android:layout_height="61dp"
android:layout_marginTop="528dp"
android:layout_width="400sp"
android:layout_height="61sp"
android:layout_marginTop="528sp"
android:ems="10"
android:hint="Message"
android:inputType="textPersonName"
Expand All @@ -62,7 +62,7 @@
android:id="@+id/sendtxt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:layout_marginTop="4sp"
android:text="Send"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
Expand All @@ -71,8 +71,8 @@

<Button
android:id="@+id/logout"
android:layout_width="78dp"
android:layout_height="39dp"
android:layout_width="78sp"
android:layout_height="39sp"
android:text="@string/logout"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
Expand Down
13 changes: 6 additions & 7 deletions app/src/main/res/layout/activity_chat_screen_splash_screen.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,13 @@
android:id="@+id/textView6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="236dp"
android:text="Yet Another Private Chat App"
android:textSize="18sp"
app:layout_constraintBottom_toTopOf="@+id/imageView"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.497"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView7"
app:layout_constraintVertical_bias="0.626" />

<TextView
Expand All @@ -31,7 +30,7 @@
app:layout_constraintHorizontal_bias="0.498"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.275" />
app:layout_constraintVertical_bias="0.082" />

<TextView
android:id="@+id/textView"
Expand All @@ -43,8 +42,8 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.498"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.441" />
app:layout_constraintTop_toBottomOf="@+id/textView6"
app:layout_constraintVertical_bias="0.339" />

<ProgressBar
android:id="@+id/progressBar2"
Expand All @@ -55,6 +54,6 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.498"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.528" />
app:layout_constraintTop_toBottomOf="@+id/textView"
app:layout_constraintVertical_bias="0.093" />
</androidx.constraintlayout.widget.ConstraintLayout>
Loading

0 comments on commit ab8bc67

Please sign in to comment.