Skip to content

Commit

Permalink
добавлены изображения в 1 билеты, подправлены кнопки и расположение к…
Browse files Browse the repository at this point in the history
…артинок
  • Loading branch information
asiman161 committed Sep 30, 2015
1 parent c9b9524 commit abd79eb
Show file tree
Hide file tree
Showing 23 changed files with 143 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* Created by Asiman on 07.06.2015.
*/
public class MainActivity extends Activity {
//test

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Expand Down
11 changes: 9 additions & 2 deletions app/src/main/java/com/example/asiman/rules/TestActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public class TestActivity extends Activity {
private ImageView imageView;
private int numberOfRightAnswers = 0;
private int numberOfQuestion = 1;
private boolean rightOrNot;
TestSetTextAndImage tstai = new TestSetTextAndImage();
Button btn1;
Button btn2;
Expand Down Expand Up @@ -105,11 +106,17 @@ public void checkTheAnswer(int numberOfWallet, int numberOfQuestion, View view){
CheckTheAnswer check = new CheckTheAnswer();
if(check.checkTheAnswer(numberOfWallet,numberOfQuestion,view)) {
numberOfRightAnswers+=1;
Toast.makeText(this, String.valueOf(numberOfRightAnswers) + " - " + String.valueOf(this.numberOfQuestion), Toast.LENGTH_SHORT).show();

Toast.makeText(this, "Верный ответ", Toast.LENGTH_SHORT).show();
}
else
Toast.makeText(this, "Неверный ответ", Toast.LENGTH_SHORT).show();
}

/*public void setImageRedOrGreen(int index){
switch (index){
case 1:
rightOrNot ?
}
}*/

}
38 changes: 19 additions & 19 deletions app/src/main/java/com/example/asiman/rules/test/Ticket1.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public void question(int index) {
switch (index) {
case 1:
this.question = "вопрос 1 билет 1";
this.image = R.drawable.image1t1;
this.image = R.drawable.image0;
this.numberOfAnswer = 3;
this.indexOfRightAnswer = 1;
break;
Expand All @@ -56,109 +56,109 @@ public void question(int index) {
break;
case 3:
this.question = "вопрос 3 билет 1";
this.image = R.drawable.image2t1;
this.image = R.drawable.image3t1;
this.numberOfAnswer = 5;
this.indexOfRightAnswer = 3;
break;
case 4:
this.question = "вопрос 4 билет 1";
this.image = R.drawable.image2t1;
this.image = R.drawable.image4t1;
this.numberOfAnswer = 5;
this.indexOfRightAnswer = 4;
break;
case 5:
this.question = "вопрос 5 билет 1";
this.image = R.drawable.image2t1;
this.image = R.drawable.image5t1;
this.numberOfAnswer = 5;
this.indexOfRightAnswer = 5;
break;
case 6:
this.question = "вопрос 6 билет 1";
this.image = R.drawable.image2t1;
this.image = R.drawable.image0;
this.numberOfAnswer = 5;
this.indexOfRightAnswer = 1;
break;
case 7:
this.question = "вопрос 7 билет 1";
this.image = R.drawable.image2t1;
this.image = R.drawable.image7t1;
this.numberOfAnswer = 5;
this.indexOfRightAnswer = 2;
break;
case 8:
this.question = "вопрос 8 билет 1";
this.image = R.drawable.image2t1;
this.image = R.drawable.image8t1;
this.numberOfAnswer = 5;
this.indexOfRightAnswer = 3;
break;
case 9:
this.question = "вопрос 9 билет 1";
this.image = R.drawable.image2t1;
this.image = R.drawable.image9t1;
this.numberOfAnswer = 5;
this.indexOfRightAnswer = 4;
break;
case 10:
this.question = "вопрос 10 билет 1";
this.image = R.drawable.image2t1;
this.image = R.drawable.image10t1;
this.numberOfAnswer = 5;
this.indexOfRightAnswer = 5;
break;
case 11:
this.question = "вопрос 11 билет 1";
this.image = R.drawable.image2t1;
this.image = R.drawable.image11t1;
this.numberOfAnswer = 5;
this.indexOfRightAnswer = 1;
break;
case 12:
this.question = "вопрос 12 билет 1";
this.image = R.drawable.image2t1;
this.image = R.drawable.image12t1;
this.numberOfAnswer = 5;
this.indexOfRightAnswer = 2;
break;
case 13:
this.question = "вопрос 13 билет 1";
this.image = R.drawable.image2t1;
this.image = R.drawable.image13t1;
this.numberOfAnswer = 5;
this.indexOfRightAnswer = 3;
break;
case 14:
this.question = "вопрос 14 билет 1";
this.image = R.drawable.image2t1;
this.image = R.drawable.image14t1;
this.numberOfAnswer = 5;
this.indexOfRightAnswer = 4;
break;
case 15:
this.question = "вопрос 15 билет 1";
this.image = R.drawable.image2t1;
this.image = R.drawable.image15t1;
this.numberOfAnswer = 5;
this.indexOfRightAnswer = 5;
break;
case 16:
this.question = "вопрос 16 билет 1";
this.image = R.drawable.image2t1;
this.image = R.drawable.image16t1;
this.numberOfAnswer = 5;
this.indexOfRightAnswer = 1;
break;
case 17:
this.question = "вопрос 17 билет 1";
this.image = R.drawable.image2t1;
this.image = R.drawable.image0;
this.numberOfAnswer = 5;
this.indexOfRightAnswer = 2;
break;
case 18:
this.question = "вопрос 18 билет 1";
this.image = R.drawable.image2t1;
this.image = R.drawable.image0;
this.numberOfAnswer = 5;
this.indexOfRightAnswer = 3;
break;
case 19:
this.question = "вопрос 19 билет 1";
this.image = R.drawable.image2t1;
this.image = R.drawable.image0;
this.numberOfAnswer = 5;
this.indexOfRightAnswer = 4;
break;
case 20:
this.question = "вопрос 20 билет 1";
this.image = R.drawable.image2t1;
this.image = R.drawable.image0;
this.numberOfAnswer = 5;
this.indexOfRightAnswer = 5;
break;
Expand Down
Binary file added app/src/main/res/drawable/grey.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/image0.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/image10t1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/image11t1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/image12t1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/image13t1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/image14t1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/image15t1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/image16t1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/drawable/image2t1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/image3t1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/image4t1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/image5t1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/image7t1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/image8t1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/image9t1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions app/src/main/res/layout/main_layout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
android:layout_centerVertical="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:textAllCaps="false"
android:onClick="goToTicketsActivity" />

<Button
Expand All @@ -28,6 +29,7 @@
android:id="@+id/btnLogo2"
android:layout_alignTop="@+id/btnLogo1"
android:layout_centerHorizontal="true"
android:textAllCaps="false"
android:onClick="goToExamActivity" />

<Button
Expand All @@ -38,6 +40,7 @@
android:layout_above="@+id/btnLogo4"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:textAllCaps="false"
android:onClick="goToRulesActivity" />

<Button
Expand All @@ -47,6 +50,7 @@
android:id="@+id/btnLogo4"
android:layout_below="@+id/btnLogo2"
android:layout_centerHorizontal="true"
android:textAllCaps="false"
android:onClick="goToStatisticActivity" />

</RelativeLayout>
118 changes: 105 additions & 13 deletions app/src/main/res/layout/test_layout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/imageView2"
android:src="@drawable/image1t1" />
android:src="@drawable/image1t1"
android:layout_gravity="center_horizontal"
android:contentDescription="@string/INF" />

<HorizontalScrollView
android:layout_width="match_parent"
Expand All @@ -30,33 +32,123 @@
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/im1"
android:src="@drawable/green"/>
android:id="@+id/img1"
android:src="@drawable/grey"
android:contentDescription="@string/INF"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/img2"
android:src="@drawable/grey"
android:contentDescription="@string/INF"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/img3"
android:src="@drawable/grey"
android:contentDescription="@string/INF"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/img4"
android:src="@drawable/grey"
android:contentDescription="@string/INF"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/img5"
android:src="@drawable/grey"
android:contentDescription="@string/INF"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/img6"
android:src="@drawable/grey"
android:contentDescription="@string/INF"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/img7"
android:src="@drawable/grey"
android:contentDescription="@string/INF"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/img8"
android:src="@drawable/grey"
android:contentDescription="@string/INF"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/img9"
android:src="@drawable/grey"
android:contentDescription="@string/INF"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/img10"
android:src="@drawable/grey"
android:contentDescription="@string/INF"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/img11"
android:src="@drawable/grey"
android:contentDescription="@string/INF"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/img12"
android:src="@drawable/grey"
android:contentDescription="@string/INF"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/img13"
android:src="@drawable/grey"
android:contentDescription="@string/INF"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/img14"
android:src="@drawable/grey"
android:contentDescription="@string/INF"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/img15"
android:src="@drawable/grey"
android:contentDescription="@string/INF"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/im2"
android:src="@drawable/red"/>
android:id="@+id/img16"
android:src="@drawable/grey"
android:contentDescription="@string/INF"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/im3"
android:src="@drawable/green"/>
android:id="@+id/img17"
android:src="@drawable/grey"
android:contentDescription="@string/INF"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/im4"
android:src="@drawable/red"/>
android:id="@+id/img18"
android:src="@drawable/grey"
android:contentDescription="@string/INF"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/im5"
android:src="@drawable/green"/>
android:id="@+id/img19"
android:src="@drawable/grey"
android:contentDescription="@string/INF"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/im6"
android:src="@drawable/red"/>
android:id="@+id/img20"
android:src="@drawable/grey"
android:contentDescription="@string/INF"/>

</LinearLayout>

Expand Down
3 changes: 3 additions & 0 deletions app/src/main/res/layout/tickets_layout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
android:text="New Button"
android:id="@+id/ticket1"
android:layout_gravity="center_horizontal"
android:textAllCaps="false"
android:onClick="goToTestActivity" />

<Button
Expand All @@ -25,6 +26,7 @@
android:text="New Button"
android:id="@+id/ticket2"
android:layout_gravity="center_horizontal"
android:textAllCaps="false"
android:onClick="goToTestActivity" />

<Button
Expand All @@ -33,5 +35,6 @@
android:text="New Button"
android:id="@+id/ticket3"
android:layout_gravity="center_horizontal"
android:textAllCaps="false"
android:onClick="goToTestActivity" />
</LinearLayout>
2 changes: 2 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@
<string name="btnAnswer4">ответ4</string>
<string name="btnAnswer5">ответ5</string>

<string name="INF">Image bot found</string>

</resources>

0 comments on commit abd79eb

Please sign in to comment.