1
0
mirror of https://github.com/bspeice/itcs4180 synced 2024-11-13 19:08:20 -05:00

Added string resources and fixed display of DetailedTweetActivity

This commit is contained in:
tokugawa 2014-04-15 16:03:40 -04:00
parent f2c2158082
commit e398045a18
7 changed files with 77 additions and 52 deletions

View File

@ -1,60 +1,79 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/LinearLayout1"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"
android:paddingBottom="@dimen/activity_vertical_margin" android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin" android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".DetailedTweetActivity" > tools:context=".DetailedTweetActivity" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical" >
<TextView <TextView
android:id="@+id/txtDetailUsername" android:id="@+id/txtDetailUsername"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentTop="true" android:layout_gravity="center_horizontal"
android:layout_centerHorizontal="true" android:text="@string/default_text" />
android:text="TextView" />
<ImageView <ImageView
android:id="@+id/imgDetailBackground" android:id="@+id/imgDetailBackground"
android:layout_width="wrap_content" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/txtDetailUsername" android:layout_gravity="center_horizontal"
android:layout_centerHorizontal="true" /> android:padding="5dp"
android:scaleType="fitStart" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<TextView <TextView
android:id="@+id/txtDetailTweet" android:id="@+id/txtDetailTweet"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignLeft="@+id/txtDetailUsername" android:layout_gravity="center_horizontal"
android:layout_below="@+id/imgDetailBackground" android:text="@string/default_text" />
android:text="TextView" />
<Button
android:id="@+id/btnDetailBack"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:onClick="onClickBack"
android:text="Button" />
<TextView <TextView
android:id="@+id/txtFavoritesCount" android:id="@+id/txtFavoritesCount"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignRight="@+id/txtDetailTweet" android:layout_gravity="center_horizontal"
android:layout_below="@+id/txtDetailTweet" android:text="@string/default_text" />
android:text="TextView" />
<TextView <TextView
android:id="@+id/txtRetweetCount" android:id="@+id/txtRetweetCount"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignLeft="@+id/txtFavoritesCount" android:layout_gravity="center_horizontal"
android:layout_below="@+id/txtFavoritesCount" android:text="@string/default_text" />
android:text="TextView" />
</RelativeLayout> </LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:orientation="vertical" >
<Button
android:id="@+id/btnDetailBack"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:onClick="onClickBack"
android:text="@string/back_button" />
</LinearLayout>
</LinearLayout>

View File

@ -25,16 +25,17 @@
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:text="View Saved News" android:onClick="onViewSaved"
android:onClick="onViewSaved" /> android:text="@string/view_saved_news_button" />
<Button <Button
android:id="@+id/btnClearSaved" android:id="@+id/btnClearSaved"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:text="Clear Saved News" android:onClick="onClearSaved"
android:onClick="onClearSaved" /> android:text="@string/clear_saved_news_button" />
</LinearLayout> </LinearLayout>
</RelativeLayout> </RelativeLayout>

View File

@ -10,7 +10,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:padding="15dp" android:padding="15dp"
android:text="Large Text" android:text="@string/default_text"
android:textAppearance="?android:attr/textAppearanceLarge" /> android:textAppearance="?android:attr/textAppearanceLarge" />
</LinearLayout> </LinearLayout>

View File

@ -22,7 +22,7 @@
android:layout_alignParentTop="true" android:layout_alignParentTop="true"
android:layout_toRightOf="@+id/imgProfileImage" android:layout_toRightOf="@+id/imgProfileImage"
android:padding="5dp" android:padding="5dp"
android:text="TextView" /> android:text="@string/default_text" />
<TextView <TextView
android:id="@+id/txtTweetInfo" android:id="@+id/txtTweetInfo"
@ -32,7 +32,7 @@
android:layout_below="@+id/txtTweetText" android:layout_below="@+id/txtTweetText"
android:layout_toLeftOf="@+id/imgIsRetweet" android:layout_toLeftOf="@+id/imgIsRetweet"
android:padding="5dp" android:padding="5dp"
android:text="TextView" /> android:text="@string/default_text" />
<ImageView <ImageView
android:id="@+id/imgIsRetweet" android:id="@+id/imgIsRetweet"

View File

@ -22,7 +22,7 @@
android:layout_alignParentTop="true" android:layout_alignParentTop="true"
android:layout_toRightOf="@+id/imgProfileImage" android:layout_toRightOf="@+id/imgProfileImage"
android:padding="5dp" android:padding="5dp"
android:text="TextView" /> android:text="@string/default_text" />
<TextView <TextView
android:id="@+id/txtTweetInfo" android:id="@+id/txtTweetInfo"
@ -32,7 +32,7 @@
android:layout_below="@+id/txtTweetText" android:layout_below="@+id/txtTweetText"
android:layout_toLeftOf="@+id/imgIsRetweet" android:layout_toLeftOf="@+id/imgIsRetweet"
android:padding="5dp" android:padding="5dp"
android:text="TextView" /> android:text="@string/default_text" />
<ImageButton <ImageButton
android:id="@+id/ibtnSaveTweet" android:id="@+id/ibtnSaveTweet"

View File

@ -7,5 +7,9 @@
<string name="title_activity_tweets_list">TweetsListActivity</string> <string name="title_activity_tweets_list">TweetsListActivity</string>
<string name="title_activity_detailed_tweet">DetailedTweetActivity</string> <string name="title_activity_detailed_tweet">DetailedTweetActivity</string>
<string name="title_activity_saved_news">SavedNewsActivity</string> <string name="title_activity_saved_news">SavedNewsActivity</string>
<string name="view_saved_news_button">View Saved News</string>
<string name="clear_saved_news_button">Clear Saved News</string>
<string name="default_text">Default</string>
<string name="back_button">Back</string>
</resources> </resources>

View File

@ -54,6 +54,7 @@ public class MainActivity extends Activity {
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main); setContentView(R.layout.activity_main);
getActionBar().setTitle("My News Tweets!");
dm = new DataManager(this); dm = new DataManager(this);
//dm.saveTweet(new SavedTweet(0, "apple", "Stuff about an apple", "00:00:12", "")); //dm.saveTweet(new SavedTweet(0, "apple", "Stuff about an apple", "00:00:12", ""));