mirror of
				https://github.com/bspeice/itcs4180
				synced 2025-11-03 18:00:37 -05:00 
			
		
		
		
	Added functionality to save and display tweets to an SQLite DB.
TODO: Add retweeted field to DB, make fix SavedNewsActivity display.
This commit is contained in:
		
							
								
								
									
										18
									
								
								HW5/res/layout/activity_saved_news.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								HW5/res/layout/activity_saved_news.xml
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,18 @@
 | 
			
		||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
 | 
			
		||||
    xmlns:tools="http://schemas.android.com/tools"
 | 
			
		||||
    android:id="@+id/container"
 | 
			
		||||
    android:layout_width="match_parent"
 | 
			
		||||
    android:layout_height="match_parent"
 | 
			
		||||
    tools:context="edu.uncc.itcs4180.hw5.SavedNewsActivity"
 | 
			
		||||
    tools:ignore="MergeRootFrame" >
 | 
			
		||||
    
 | 
			
		||||
    <ListView
 | 
			
		||||
        android:id="@+id/listTweetList"
 | 
			
		||||
        android:layout_width="match_parent"
 | 
			
		||||
        android:layout_height="wrap_content"
 | 
			
		||||
        android:layout_alignParentLeft="true"
 | 
			
		||||
        android:layout_alignParentTop="true" >
 | 
			
		||||
    </ListView>
 | 
			
		||||
    
 | 
			
		||||
</RelativeLayout>
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										55
									
								
								HW5/res/layout/saved_tweets_list.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										55
									
								
								HW5/res/layout/saved_tweets_list.xml
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,55 @@
 | 
			
		||||
<?xml version="1.0" encoding="utf-8"?>
 | 
			
		||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
 | 
			
		||||
    android:id="@+id/RelativeLayout1"
 | 
			
		||||
    android:layout_width="fill_parent"
 | 
			
		||||
    android:layout_height="fill_parent"
 | 
			
		||||
    android:descendantFocusability="blocksDescendants"
 | 
			
		||||
    android:padding="2dp" >
 | 
			
		||||
 | 
			
		||||
    <ImageView
 | 
			
		||||
        android:id="@+id/imgProfileImage"
 | 
			
		||||
        android:layout_width="60dp"
 | 
			
		||||
        android:layout_height="60dp"
 | 
			
		||||
        android:layout_alignParentLeft="true"
 | 
			
		||||
        android:layout_alignParentTop="true"
 | 
			
		||||
        android:padding="5dp"
 | 
			
		||||
        android:src="@drawable/ic_launcher" />
 | 
			
		||||
 | 
			
		||||
    <TextView
 | 
			
		||||
        android:id="@+id/txtTweetText"
 | 
			
		||||
        android:layout_width="fill_parent"
 | 
			
		||||
        android:layout_height="wrap_content"
 | 
			
		||||
        android:layout_alignParentTop="true"
 | 
			
		||||
        android:layout_toRightOf="@+id/imgProfileImage"
 | 
			
		||||
        android:padding="5dp"
 | 
			
		||||
        android:text="TextView" />
 | 
			
		||||
 | 
			
		||||
    <TextView
 | 
			
		||||
        android:id="@+id/txtTweetInfo"
 | 
			
		||||
        android:layout_width="wrap_content"
 | 
			
		||||
        android:layout_height="wrap_content"
 | 
			
		||||
        android:layout_alignLeft="@+id/txtTweetText"
 | 
			
		||||
        android:layout_below="@+id/txtTweetText"
 | 
			
		||||
        android:layout_toLeftOf="@+id/imgIsRetweet"
 | 
			
		||||
        android:padding="5dp"
 | 
			
		||||
        android:text="TextView" />
 | 
			
		||||
 | 
			
		||||
    <ImageButton
 | 
			
		||||
        android:id="@+id/ibtnSaveTweet"
 | 
			
		||||
        android:layout_width="50dp"
 | 
			
		||||
        android:layout_height="50dp"
 | 
			
		||||
        android:layout_alignParentRight="true"
 | 
			
		||||
        android:layout_below="@+id/txtTweetText"
 | 
			
		||||
        android:padding="5dp"
 | 
			
		||||
        android:visibility="invisible" />
 | 
			
		||||
 | 
			
		||||
    <ImageView
 | 
			
		||||
        android:id="@+id/imgIsRetweet"
 | 
			
		||||
        android:layout_width="50dp"
 | 
			
		||||
        android:layout_height="50dp"
 | 
			
		||||
        android:layout_alignTop="@+id/ibtnSaveTweet"
 | 
			
		||||
        android:layout_toLeftOf="@+id/ibtnSaveTweet"
 | 
			
		||||
        android:padding="5dp"
 | 
			
		||||
        android:src="@drawable/not_retweeted" />
 | 
			
		||||
 | 
			
		||||
</RelativeLayout>
 | 
			
		||||
							
								
								
									
										12
									
								
								HW5/res/menu/saved_news.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								HW5/res/menu/saved_news.xml
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,12 @@
 | 
			
		||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
 | 
			
		||||
    xmlns:app="http://schemas.android.com/apk/res-auto"
 | 
			
		||||
    xmlns:tools="http://schemas.android.com/tools"
 | 
			
		||||
    tools:context="edu.uncc.itcs4180.hw5.SavedNewsActivity" >
 | 
			
		||||
 | 
			
		||||
    <item
 | 
			
		||||
        android:id="@+id/action_settings"
 | 
			
		||||
        android:orderInCategory="100"
 | 
			
		||||
        android:title="@string/action_settings"
 | 
			
		||||
        app:showAsAction="never"/>
 | 
			
		||||
 | 
			
		||||
</menu>
 | 
			
		||||
							
								
								
									
										10
									
								
								HW5/res/values-w820dp/dimens.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								HW5/res/values-w820dp/dimens.xml
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,10 @@
 | 
			
		||||
<resources>
 | 
			
		||||
 | 
			
		||||
    <!--
 | 
			
		||||
         Example customization of dimensions originally defined in res/values/dimens.xml
 | 
			
		||||
         (such as screen margins) for screens with more than 820dp of available width. This
 | 
			
		||||
         would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively).
 | 
			
		||||
    -->
 | 
			
		||||
    <dimen name="activity_horizontal_margin">64dp</dimen>
 | 
			
		||||
 | 
			
		||||
</resources>
 | 
			
		||||
@ -6,5 +6,6 @@
 | 
			
		||||
    <string name="hello_world">Hello world!</string>
 | 
			
		||||
    <string name="title_activity_tweets_list">TweetsListActivity</string>
 | 
			
		||||
    <string name="title_activity_detailed_tweet">DetailedTweetActivity</string>
 | 
			
		||||
    <string name="title_activity_saved_news">SavedNewsActivity</string>
 | 
			
		||||
 | 
			
		||||
</resources>
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user