Skip to content

Commit 4fe1014

Browse files
author
Arnav Gupta
committed
make all news item in list of smae sized rows
1 parent 34f9c71 commit 4fe1014

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

App/src/main/java/in/ac/dtu/subtlenews/MainFragment.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@
1717
import android.view.LayoutInflater;
1818
import android.view.View;
1919
import android.view.ViewGroup;
20+
import android.widget.AbsListView;
2021
import android.widget.AdapterView;
2122
import android.widget.BaseAdapter;
23+
import android.widget.LinearLayout;
2224
import android.widget.ListView;
2325
import android.widget.TextView;
2426
import android.widget.Toast;
@@ -270,9 +272,11 @@ public View getView(int position, View convertView, ViewGroup parent) {
270272
rowView = convertView;
271273
}
272274

275+
LinearLayout newsItem = (LinearLayout) rowView.findViewById(R.id.news_item);
273276
TextView newsTitle = (TextView) rowView.findViewById(R.id.title_news);
274277
TextView sourceName = (TextView) rowView.findViewById(R.id.source_news);
275278
TextView newsDate = (TextView) rowView.findViewById(R.id.date_news);
279+
newsItem.setLayoutParams(new AbsListView.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, 175));
276280
sourceName.setTextColor(Color.GRAY);
277281
sourceName.setTextSize(10);
278282
newsDate.setTextColor(Color.GRAY);

App/src/main/java/in/ac/dtu/subtlenews/NavigationDrawerFragment.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ public View getView(int pos, View convertView, ViewGroup parent) {
318318
//navigationTitle.setTextColor(Color.WHITE);
319319
navigationIcon.setBackgroundResource(R.drawable.ic_launcher);
320320

321-
String s = mCategoryMap[pos].toString();
321+
String s = mCategoryMap[pos];
322322
if (s.equals("World")) {
323323
navigationIcon.setBackgroundResource(R.drawable.world);
324324

App/src/main/res/layout/row_list.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22

33
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
4+
android:id="@+id/news_item"
45
android:orientation="vertical"
56
android:layout_width="match_parent"
67
android:layout_height="60dp"

0 commit comments

Comments
 (0)