Created
June 23, 2018 06:16
-
-
Save khkred/baf22b18f85e83ad88644e5f091e182e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:background="#B388FF" | |
android:orientation="vertical" | |
tools:context=".MainActivity"> | |
<ImageView | |
android:id="@+id/android_cookie_image_view" | |
android:layout_width="match_parent" | |
android:layout_height="0dp" | |
android:layout_weight="1" | |
android:scaleType="centerCrop" | |
android:src="@drawable/before_cookie" /> | |
<TextView | |
android:id="@+id/status_text_view" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:layout_marginLeft="16dp" | |
android:layout_marginRight="16dp" | |
android:layout_marginTop="16dp" | |
android:text="I'm so hungry" | |
android:textColor="@android:color/white" | |
android:textSize="34sp" /> | |
<Button | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:layout_margin="16dp" | |
android:text="EAT COOKIE" /> | |
</LinearLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MainActivity extends AppCompatActivity { | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
} | |
/** | |
* Called when the cookie should be eaten. | |
*/ | |
public void eatCookie(View view) { | |
// TODO: Find a reference to the ImageView in the layout. Change the image. | |
// TODO: Find a reference to the TextView in the layout. Change the text. | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment