Skip to content

Commit

Permalink
[~] fix mad bug on relations and login
Browse files Browse the repository at this point in the history
  • Loading branch information
denvash committed Jan 21, 2019
1 parent 90fb2fe commit c7e30db
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 25 deletions.
3 changes: 3 additions & 0 deletions app/src/main/java/com/jesta/gui/activities/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,9 @@ class MainActivity : AppCompatActivity(), FragNavController.RootFragmentListener
}

fun restart() {
if (!fragNavController.isRootFragment) {
fragNavController.clearStack()
}
finish()
startActivity(Intent.makeRestartActivityTask(intent.component))
}
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/jesta/utils/db/SysManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,7 @@ public void onChildAdded(@NonNull DataSnapshot ds, @Nullable String s) {

// don't show message that don't belong to you!
Relation relation = ds.getValue(Relation.class);
if (!relation.getDoerID().equals(getCurrentUserFromDB().getId()) && !relation.getPosterID().equals(getCurrentUserFromDB().getId())) {
if (getCurrentUserFromDB() == null || !relation.getDoerID().equals(getCurrentUserFromDB().getId()) && !relation.getPosterID().equals(getCurrentUserFromDB().getId())) {
return;
}

Expand Down
47 changes: 24 additions & 23 deletions app/src/main/res/layout/jesta_status.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,34 @@

<com.github.florent37.expansionpanel.ExpansionHeader
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="match_parent"
app:expansion_headerIndicator="@id/statusHeaderIndicator"
app:expansion_layout="@id/statusExpansionLayout"
app:expansion_toggleOnClick="true">

<!-- HEADER -->
<GridLayout
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:backgroundTint="@color/black"
android:columnCount="4">
android:backgroundTint="@color/black">

<de.hdodenhof.circleimageview.CircleImageView xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_columnWeight="1"
android:id="@+id/jesta_status_avatar"
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_gravity="center"
android:layout_gravity="start"
android:layout_marginEnd="10dp"
app:civ_border_color="@color/colorPrimary"
app:civ_border_width="0.75dp" />

<LinearLayout
android:id="@+id/jesta_status_mission_data"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:layout_toStartOf="@+id/jesta_status_data"
android:layout_toEndOf="@id/jesta_status_avatar"
android:gravity="start"
android:orientation="vertical">

Expand All @@ -48,27 +51,25 @@
<TextView
android:id="@+id/jesta_status_job"
style="@style/TextAppearance.Jesta.Type.Purple"
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:text="@string/jesta_status_job" />
</LinearLayout>


<LinearLayout
android:id="@+id/jesta_status_data"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_column="2"
android:layout_columnWeight="1"
android:layout_gravity="center|end"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:orientation="horizontal">

<TextView
android:id="@+id/jesta_status_total_doers"
style="@style/Widget.Jesta.Tag.NumOfPeople"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_gravity="center_vertical|end"
android:fontFamily="@font/marvel"
android:text="@string/jesta_status_total_users" />

Expand All @@ -85,21 +86,21 @@
style="@style/TextAppearance.Jesta.Type"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center|end"
android:layout_gravity="center_vertical|end"
android:text="@string/jesta_status_phase" />

<ImageView
android:id="@+id/statusHeaderIndicator"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_gravity="center"
android:contentDescription="@string/jesta_settings_edit_profile_icon_description"
android:src="@drawable/ic_right_arrow" />
</LinearLayout>

<!-- HEADER INDICATOR -->
<ImageView
android:id="@+id/statusHeaderIndicator"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|end"
android:layout_marginStart="20dp"
android:contentDescription="@string/jesta_settings_edit_profile_icon_description"
android:src="@drawable/ic_right_arrow" />

</GridLayout>
</RelativeLayout>


</com.github.florent37.expansionpanel.ExpansionHeader>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@

<!--Jesta Status-->
<string name="jesta_status_phase">Phase</string>
<string name="jesta_status_total_users">Total Users</string>
<string name="jesta_status_total_users">10</string>
<string name="jesta_status_title">Jesta Title</string>
<string name="jesta_status_job">Job</string>
<string name="jesta_status_assign_a_doer">Assign a Doer</string>
Expand Down

0 comments on commit c7e30db

Please sign in to comment.