Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Kim-Jong-Gyu committed Jan 22, 2021
2 parents 6298ae1 + 1c688fd commit 723d903
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ListView;

import androidx.appcompat.app.AppCompatActivity;
Expand All @@ -24,8 +26,9 @@ protected void onCreate(Bundle savedInstanceState) {
Intent intent = getIntent();
ArrayList<MyWord> wordArrayList = (ArrayList<MyWord>) intent.getSerializableExtra("wordTestResult");
MyWord myWord = new MyWord();
myWord.setGroupName("칼럼");
// myWord.setKoreanWord();
myWord.setKoreanWord("의미");
myWord.setEnglishWord("단어");
myWord.setUserTestWord("답안");
wordArrayList.add(0, myWord); //0인덱스는 보기 넣을거라 그냥 빈 오브젝트넣음

ListView listView = findViewById(R.id.word_list);
Expand All @@ -34,6 +37,14 @@ protected void onCreate(Bundle savedInstanceState) {

listView.setAdapter(wordListAdapter);

Button button = findViewById(R.id.backMainBtn);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});


}
}
13 changes: 8 additions & 5 deletions app/src/main/java/com/memoria/adapter/TestResultListAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
public class TestResultListAdapter extends ArrayAdapter<MyWord> {

private ArrayList<MyWord> items;
TextView wordNum;

public TestResultListAdapter(Context context, int textViewResourceId, ArrayList<MyWord> objects) {
super(context, textViewResourceId, objects);
Expand All @@ -32,13 +33,13 @@ public View getView(final int position, View convertView, ViewGroup parent) {
}

LinearLayout linearLayout = v.findViewById(R.id.item_layout);
TextView wordNum = v.findViewById(R.id.word_num);
wordNum = v.findViewById(R.id.word_num);
TextView englishWordText = v.findViewById(R.id.english_word);
TextView koreanWordText = v.findViewById(R.id.korean_word);
TextView userWordText = v.findViewById(R.id.user_wrod);

if (items.get(position).getGroupName().equals("칼럼") ){
wordNum.setText("문제");
if (position==0){
wordNum.setText("번호");
englishWordText.setText("단어");
koreanWordText.setText("의미");
userWordText.setText("답안");
Expand All @@ -48,12 +49,14 @@ public View getView(final int position, View convertView, ViewGroup parent) {
koreanWordText.setTextColor(Color.BLACK);
userWordText.setTextColor(Color.BLACK);

linearLayout.setBackgroundResource(R.drawable.shape_rectangle_shadow_white_coners_10);
wordNum.setBackgroundResource(R.drawable.shape_rectangle_shadow_gray_10);
englishWordText.setBackgroundResource(R.drawable.shape_rectangle_shadow_gray_10);
koreanWordText.setBackgroundResource(R.drawable.shape_rectangle_shadow_gray_10);
userWordText.setBackgroundResource(R.drawable.shape_rectangle_shadow_gray_10);
}else {

wordNum.setText(position+"");
linearLayout.setBackgroundResource(R.drawable.shape_rectangle_shadow_white_coners_10);
if (!(items.get(position).getKoreanWord().equals(items.get(position).getUserTestWord()))) {
linearLayout.setBackgroundResource(R.drawable.shape_rectangle_shadow_red_coners_10);
wordNum.setTextColor(Color.RED);
Expand All @@ -64,7 +67,7 @@ public View getView(final int position, View convertView, ViewGroup parent) {
userWordText.setTextColor(Color.parseColor("#707070"));
}
}
wordNum.setText(position+"");

englishWordText.setText(items.get(position).getEnglishWord());
koreanWordText.setText(items.get(position).getKoreanWord());
userWordText.setText(items.get(position).getUserTestWord());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<shape>
<corners android:radius="5dp"/>
<padding android:bottom="1dp" android:left="1dp" android:right="1dp" android:top="1dp" />
<solid android:color="#0ACCCCCC" />
<solid android:color="#0AE3E3E3" />
</shape>
</item>
<item>
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/layout/fragment_test.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
android:scrollbars="none"
android:layout_above="@id/btn_test_start"
android:layout_below="@id/title_text"
android:layout_marginTop="45dp"
android:numColumns="2"
android:paddingTop="30dp" />

Expand Down
4 changes: 1 addition & 3 deletions app/src/main/res/layout/fragment_test2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
android:scrollbars="none"
android:layout_above="@id/btn_test_start2"
android:layout_below="@id/title_text2"
android:layout_marginTop="45dp"
android:choiceMode="multipleChoice"
android:numColumns="2"
android:listSelector="@android:color/transparent"
Expand All @@ -48,9 +47,8 @@
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/title_text"
android:layout_below="@+id/title_text2"
android:layout_centerHorizontal="true"
android:layout_marginTop="35dp"
android:text="테스트할 그룹을 터치해주세요"
android:textColor="#090707"
android:textSize="16dp" />
Expand Down

0 comments on commit 723d903

Please sign in to comment.