Skip to content
This repository has been archived by the owner on Jul 12, 2022. It is now read-only.

Commit

Permalink
앱 첫화면에 급식표시, 댓글이 제대로 안보이는 버그 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
leehj050211 committed Oct 30, 2021
1 parent 628a321 commit b929c29
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 31 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ android {
applicationId "com.zzz2757.bsm"
minSdk 21
targetSdk 30
versionCode 4
versionName "Beta 0.2.1"
versionCode 5
versionName "Beta 0.2.2"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down
28 changes: 14 additions & 14 deletions app/src/main/java/com/zzz2757/bsm/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,16 @@ protected void onCreate(Bundle savedInstanceState) {
@Override
public boolean onNavigationItemSelected(@NonNull MenuItem menuItem) {
switch(menuItem.getItemId()){
case R.id.action_login:
case R.id.action_meal:
setFrag(0);
break;
case R.id.action_board:
case R.id.action_timetable:
setFrag(1);
break;
case R.id.action_meal:
bundle.putString("page", "meal");
mealFrag.setArguments(bundle);
case R.id.action_board:
setFrag(2);
break;
case R.id.action_timetable:
bundle.putString("page", "timetable");
timetableFrag.setArguments(bundle);
case R.id.action_login:
setFrag(3);
break;
}
Expand All @@ -87,19 +83,23 @@ private void setFrag(int n){
fragmentTransaction= fragmentManager.beginTransaction();
switch(n){
case 0:
fragmentTransaction.replace(R.id.Main_Frame, loginFrag);
bundle.putString("page", "meal");
mealFrag.setArguments(bundle);
fragmentTransaction.replace(R.id.Main_Frame, mealFrag);
fragmentTransaction.commit();
break;
case 1:
Intent intent = new Intent(this, BoardActivity.class);
startActivity(intent);
bundle.putString("page", "timetable");
timetableFrag.setArguments(bundle);
fragmentTransaction.replace(R.id.Main_Frame, timetableFrag);
fragmentTransaction.commit();
break;
case 2:
fragmentTransaction.replace(R.id.Main_Frame, mealFrag);
fragmentTransaction.commit();
Intent intent = new Intent(this, BoardActivity.class);
startActivity(intent);
break;
case 3:
fragmentTransaction.replace(R.id.Main_Frame, timetableFrag);
fragmentTransaction.replace(R.id.Main_Frame, loginFrag);
fragmentTransaction.commit();
break;
}
Expand Down
21 changes: 14 additions & 7 deletions app/src/main/res/layout/activity_board_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@
android:layout_height="match_parent"
android:layout_marginTop="46dp"
android:layout_marginBottom="48dp"
app:layout_constraintTop_toBottomOf="@+id/post_top_bar" >
app:layout_constraintTop_toBottomOf="@+id/post_top_bar"
app:layout_constraintBottom_toTopOf="@id/post_edit_comment_bar">

<LinearLayout
android:layout_width="match_parent"
Expand Down Expand Up @@ -203,14 +204,20 @@

</RelativeLayout>

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/comment_recycler"
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintVertical_weight="1"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/post_like_wrap" />
app:layout_constraintTop_toBottomOf="@+id/post_like_wrap" >

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/comment_recycler"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintVertical_weight="1"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />

</RelativeLayout>

</LinearLayout>

Expand Down
16 changes: 8 additions & 8 deletions app/src/main/res/menu/menu_main.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">

<item
android:id="@+id/action_login"
android:title="로그인"/>

<item
android:id="@+id/action_board"
android:title="커뮤니티"/>

<item
android:id="@+id/action_meal"
android:title="급식"/>
Expand All @@ -17,4 +9,12 @@
android:id="@+id/action_timetable"
android:title="시간표"/>

<item
android:id="@+id/action_board"
android:title="커뮤니티"/>

<item
android:id="@+id/action_login"
android:title="로그인"/>

</menu>

0 comments on commit b929c29

Please sign in to comment.