1
0
mirror of https://github.com/bspeice/itcs4180 synced 2024-12-03 20:58:12 -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"
android:id="@+id/LinearLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".DetailedTweetActivity" >
<TextView
android:id="@+id/txtDetailUsername"
android:layout_width="wrap_content"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:text="TextView" />
android:layout_weight="1"
android:orientation="vertical" >
<ImageView
android:id="@+id/imgDetailBackground"
android:layout_width="wrap_content"
<TextView
android:id="@+id/txtDetailUsername"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="@string/default_text" />
<ImageView
android:id="@+id/imgDetailBackground"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:padding="5dp"
android:scaleType="fitStart" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/txtDetailUsername"
android:layout_centerHorizontal="true" />
android:orientation="vertical" >
<TextView
android:id="@+id/txtDetailTweet"
android:layout_width="wrap_content"
<TextView
android:id="@+id/txtDetailTweet"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="@string/default_text" />
<TextView
android:id="@+id/txtFavoritesCount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="@string/default_text" />
<TextView
android:id="@+id/txtRetweetCount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="@string/default_text" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/txtDetailUsername"
android:layout_below="@+id/imgDetailBackground"
android:text="TextView" />
android:layout_gravity="bottom"
android:orientation="vertical" >
<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" />
<Button
android:id="@+id/btnDetailBack"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:onClick="onClickBack"
android:text="@string/back_button" />
<TextView
android:id="@+id/txtFavoritesCount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignRight="@+id/txtDetailTweet"
android:layout_below="@+id/txtDetailTweet"
android:text="TextView" />
</LinearLayout>
<TextView
android:id="@+id/txtRetweetCount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/txtFavoritesCount"
android:layout_below="@+id/txtFavoritesCount"
android:text="TextView" />
</RelativeLayout>
</LinearLayout>

View File

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

View File

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

View File

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

View File

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

View File

@ -7,5 +7,9 @@
<string name="title_activity_tweets_list">TweetsListActivity</string>
<string name="title_activity_detailed_tweet">DetailedTweetActivity</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>

View File

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