Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add: ranking패키지 생성 및 rank관련 fragment 생성과 nav_rank파일 생성 #3

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".ui.auth.AuthActivity"></activity>
<activity android:name=".ui.ranking.RankingActivity"></activity>
<activity android:name=".ui.auth.AuthActivity" />
<activity android:name=".ui.main.MainActivity" />
<activity android:name=".ui.SplashActivity">
<intent-filter>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import com.example.wordmemorizationgame.R;
import com.example.wordmemorizationgame.ui.auth.AuthActivity;
import com.example.wordmemorizationgame.ui.main.MainActivity;
import com.example.wordmemorizationgame.ui.ranking.RankingActivity;

public class SplashActivity extends AppCompatActivity {

Expand All @@ -26,7 +27,7 @@ void startSplash() {
@Override
public void run() {
//
Intent intent = new Intent(getApplicationContext(), AuthActivity.class);
Intent intent = new Intent(getApplicationContext(), RankingActivity.class);
startActivity(intent);
finish();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ protected void onCreate(Bundle savedInstanceState) {
NavController navController = Navigation.findNavController(this, R.id.nav_auth_fragment);
appBarConfiguration = new AppBarConfiguration.Builder(navController.getGraph()).build();
NavigationUI.setupActionBarWithNavController(this, navController, appBarConfiguration);

}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package com.example.wordmemorizationgame.ui.ranking;

import android.os.Bundle;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.example.wordmemorizationgame.R;

public class FavorRankingFragment extends Fragment {

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_favor_ranking, container, false);
}

@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
package com.example.wordmemorizationgame.ui.ranking;

import android.os.Bundle;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.navigation.Navigation;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.example.wordmemorizationgame.R;

public class MainRankingFragment extends Fragment {

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
return inflater.inflate(R.layout.fragment_main_ranking, container, false);
}

@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);


view.findViewById(R.id.btn_mainrank_favor).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Navigation.findNavController(view).navigate(R.id.action_mainRankingFragment_to_favorRankingFragment);
}
});

view.findViewById(R.id.btn_mainrank_wrong).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Navigation.findNavController(view).navigate(R.id.action_mainRankingFragment_to_wrongRankingFragment);
}
});

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.example.wordmemorizationgame.ui.ranking;

import androidx.appcompat.app.AppCompatActivity;
import androidx.navigation.NavController;
import androidx.navigation.Navigation;
import androidx.navigation.ui.AppBarConfiguration;
import androidx.navigation.ui.NavigationUI;

import android.os.Bundle;

import com.example.wordmemorizationgame.R;

public class RankingActivity extends AppCompatActivity {
AppBarConfiguration appBarConfiguration;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_ranking);

NavController navController = Navigation.findNavController(this, R.id.nav_rank_fragment);
appBarConfiguration = new AppBarConfiguration.Builder(navController.getGraph()).build();
NavigationUI.setupActionBarWithNavController(this, navController, appBarConfiguration);
}

@Override
public boolean onSupportNavigateUp() {
NavController navController = Navigation.findNavController(this, R.id.nav_rank_fragment);
return NavigationUI.navigateUp(navController, appBarConfiguration) || super.onSupportNavigateUp();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package com.example.wordmemorizationgame.ui.ranking;

import android.os.Bundle;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.example.wordmemorizationgame.R;


public class WrongRankingFragment extends Fragment {


@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_wrong_ranking, container, false);
}

@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
}
}
16 changes: 16 additions & 0 deletions app/src/main/res/layout/activity_ranking.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?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="match_parent"
android:layout_height="match_parent"
tools:context=".ui.ranking.RankingActivity">

<fragment
android:id="@+id/nav_rank_fragment"
android:name="androidx.navigation.fragment.NavHostFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:defaultNavHost="true"
app:navGraph="@navigation/nav_rank" />
</androidx.constraintlayout.widget.ConstraintLayout>
27 changes: 27 additions & 0 deletions app/src/main/res/layout/fragment_favor_ranking.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout 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"
tools:context=".ui.ranking.FavorRankingFragment"

>

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">

<ImageView
android:id="@+id/imageView5"
android:layout_width="68dp"
android:layout_height="84dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@android:drawable/btn_star_big_on"
tools:src="@tools:sample/avatars" />

</androidx.constraintlayout.widget.ConstraintLayout>
</FrameLayout>
50 changes: 50 additions & 0 deletions app/src/main/res/layout/fragment_main_ranking.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout 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"
tools:context=".ui.ranking.FavorRankingFragment"
>

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">

<Button
android:id="@+id/btn_mainrank_wrong"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="296dp"
android:text="자주 틀린 단어"
app:layout_constraintBottom_toTopOf="@+id/btn_mainrank_favor"
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.044" />

<Button
android:id="@+id/btn_mainrank_favor"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="272dp"
android:text="즐겨 찾는 단어"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.498"
app:layout_constraintStart_toStartOf="parent" />

<TextView
android:id="@+id/txt_mainrank_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Ranking"
android:textSize="24sp"
app:layout_constraintBottom_toTopOf="@+id/btn_mainrank_wrong"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>
</FrameLayout>
27 changes: 27 additions & 0 deletions app/src/main/res/layout/fragment_wrong_ranking.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout 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"
tools:context=".ui.ranking.FavorRankingFragment"

>

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">

<ImageView
android:id="@+id/imageView5"
android:layout_width="68dp"
android:layout_height="84dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@android:drawable/ic_delete"
tools:src="@tools:sample/avatars" />

</androidx.constraintlayout.widget.ConstraintLayout>
</FrameLayout>
36 changes: 36 additions & 0 deletions app/src/main/res/navigation/nav_rank.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<navigation 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:id="@+id/nav_rank"
app:startDestination="@id/mainRankingFragment">

<fragment
android:id="@+id/favorRankingFragment"
android:name="com.example.wordmemorizationgame.ui.ranking.FavorRankingFragment"
android:label="fragment_main_ranking"
tools:layout="@layout/fragment_main_ranking" >
<action
android:id="@+id/action_favorRankingFragment_to_mainRankingFragment"
app:destination="@id/mainRankingFragment" />
</fragment>
<fragment
android:id="@+id/wrongRankingFragment"
android:name="com.example.wordmemorizationgame.ui.ranking.WrongRankingFragment"
android:label="WrongRankingFragment" >
<action
android:id="@+id/action_wrongRankingFragment_to_mainRankingFragment"
app:destination="@id/mainRankingFragment" />
</fragment>
<fragment
android:id="@+id/mainRankingFragment"
android:name="com.example.wordmemorizationgame.ui.ranking.MainRankingFragment"
android:label="MainRankingFragment" >
<action
android:id="@+id/action_mainRankingFragment_to_wrongRankingFragment"
app:destination="@id/wrongRankingFragment" />
<action
android:id="@+id/action_mainRankingFragment_to_favorRankingFragment"
app:destination="@id/favorRankingFragment" />
</fragment>
</navigation>