Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Android Tutorial #4 - Layouts & Resources
- Loading branch information
1 parent
8d6134a
commit c436afa
Showing
5 changed files
with
32 additions
and
11 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,14 @@ | ||
package net.rafaeltoledo.tutorial; | ||
|
||
import android.content.Intent; | ||
import android.os.Bundle; | ||
import android.support.annotation.Nullable; | ||
import android.support.v7.app.AppCompatActivity; | ||
import android.util.Log; | ||
|
||
public class MainActivity extends AppCompatActivity { | ||
|
||
@Override | ||
protected void onCreate(@Nullable Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
Intent intent = getIntent(); | ||
Log.d("MA::Action", intent.getAction()); | ||
for (String category : intent.getCategories()) { | ||
Log.d("MA::Category", category); | ||
} | ||
Log.d("MA::Component", intent.getComponent().getClassName()); | ||
setContentView(R.layout.activity_main); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:gravity="center_vertical" | ||
android:orientation="vertical"> | ||
|
||
<EditText | ||
android:id="@+id/name" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:hint="@string/name" /> | ||
|
||
<EditText | ||
android:id="@+id/address" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:hint="@string/address" /> | ||
|
||
<Button | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:text="@string/save" /> | ||
|
||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
<resources> | ||
<string name="app_name">Tutorial</string> | ||
<string name="save">Save</string> | ||
<string name="address">Address</string> | ||
<string name="name">Name</string> | ||
</resources> |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#Mon Jan 09 21:18:07 BRST 2017 | ||
#Thu Jan 12 00:03:20 BRST 2017 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-3.2-all.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip |