-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed everything and finished application
- Loading branch information
Showing
12 changed files
with
207 additions
and
58 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
85 changes: 85 additions & 0 deletions
85
app/src/main/java/org/example/module1/app/HyperlinkArrayAdapter.java
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,85 @@ | ||
package org.example.module1.app; | ||
|
||
import android.app.Activity; | ||
import android.content.Context; | ||
import android.view.LayoutInflater; | ||
import android.view.View; | ||
import android.view.ViewGroup; | ||
import android.widget.ArrayAdapter; | ||
import android.widget.TextView; | ||
|
||
import java.util.List; | ||
|
||
public class HyperlinkArrayAdapter extends ArrayAdapter<Hyperlink> { | ||
Context context; | ||
int layoutResourceId; | ||
Hyperlink[] hyperlinks; | ||
|
||
public HyperlinkArrayAdapter(Context context, int resource) { | ||
super(context, resource); | ||
} | ||
|
||
public HyperlinkArrayAdapter(Context context, int resource, int textViewResourceId) { | ||
super(context, resource, textViewResourceId); | ||
} | ||
|
||
public HyperlinkArrayAdapter(Context context, int resource, Hyperlink[] objects) { | ||
super(context, resource, objects); | ||
this.layoutResourceId = resource; | ||
this.context = context; | ||
this.hyperlinks = objects; | ||
} | ||
|
||
public HyperlinkArrayAdapter(Context context, int resource, int textViewResourceId, Hyperlink[] objects) { | ||
super(context, resource, textViewResourceId, objects); | ||
} | ||
|
||
public HyperlinkArrayAdapter(Context context, int resource, List<Hyperlink> objects) { | ||
super(context, resource, objects); | ||
} | ||
|
||
public HyperlinkArrayAdapter(Context context, int resource, int textViewResourceId, List<Hyperlink> objects) { | ||
super(context, resource, textViewResourceId, objects); | ||
} | ||
|
||
|
||
@Override | ||
public View getView(int position, View convertView, ViewGroup parent) { | ||
View row = convertView; | ||
HyperlinkHolder holder; | ||
|
||
if (row == null) { | ||
LayoutInflater inflater = ((Activity) context).getLayoutInflater(); | ||
row = inflater.inflate(layoutResourceId, parent, false); | ||
|
||
holder = new HyperlinkHolder(); | ||
holder.txtID = (TextView) row.findViewById(R.id.hyperlinkID); | ||
holder.txtDescription = (TextView) row.findViewById(R.id.hyperlinkDescription); | ||
holder.txtURL = (TextView) row.findViewById(R.id.hyperlinkURL); | ||
holder.txtCategory = (TextView) row.findViewById(R.id.hyperlinkCategory); | ||
holder.txtTimestamp = (TextView) row.findViewById(R.id.hyperlinkTimestamp); | ||
|
||
row.setTag(holder); | ||
} else { | ||
holder = (HyperlinkHolder) row.getTag(); | ||
} | ||
|
||
Hyperlink h = hyperlinks[position]; | ||
holder.txtID.setText(h.ID.toString()); | ||
holder.txtDescription.setText(h.Description); | ||
holder.txtURL.setText(h.URL); | ||
holder.txtCategory.setText(context.getResources().getStringArray(R.array.cats)[h.Category]); | ||
holder.txtTimestamp.setText(h.Timestamp); | ||
|
||
return row; | ||
} | ||
|
||
|
||
static class HyperlinkHolder { | ||
TextView txtID; | ||
TextView txtDescription; | ||
TextView txtURL; | ||
TextView txtCategory; | ||
TextView txtTimestamp; | ||
} | ||
} |
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
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,15 +1,11 @@ | ||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
tools:context="org.example.module1.app.ListFragment" > | ||
<ScrollView | ||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:id="@+id/scrollView" > | ||
<ExpandableListView | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:id="@+id/hyperlinkListView" /> | ||
</ScrollView > | ||
</RelativeLayout > | ||
android:fillViewport="true" | ||
tools:context="org.example.module1.app.ListFragment" > | ||
<ListView | ||
android:layout_width="wrap_content" | ||
android:layout_height="match_parent" | ||
android:id="@+id/hyperlinkListView" /> | ||
</ScrollView > |
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,81 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:orientation="vertical" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" > | ||
<RelativeLayout android:layout_width="match_parent" | ||
android:layout_height="0dp" | ||
android:layout_weight="1" > | ||
<TextView | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:textAppearance="?android:attr/textAppearanceMedium" | ||
android:text="@string/description" | ||
android:id="@+id/textViewDescription" | ||
android:layout_centerVertical="true" | ||
android:layout_alignParentStart="true" /> | ||
<TextView | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:textAppearance="?android:attr/textAppearanceMedium" | ||
android:id="@+id/hyperlinkDescription" | ||
android:layout_centerVertical="true" | ||
android:layout_alignParentEnd="true" /> | ||
</RelativeLayout > | ||
<RelativeLayout android:layout_width="match_parent" | ||
android:layout_height="0dp" | ||
android:layout_weight="1" > | ||
<TextView | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:textAppearance="?android:attr/textAppearanceMedium" | ||
android:text="URL" | ||
android:id="@+id/textView3" | ||
android:layout_centerVertical="true" | ||
android:layout_alignParentStart="true" /> | ||
<TextView | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:textAppearance="?android:attr/textAppearanceMedium" | ||
android:id="@+id/hyperlinkURL" | ||
android:layout_alignBottom="@+id/textView3" | ||
android:layout_alignParentEnd="true" /> | ||
</RelativeLayout > | ||
<RelativeLayout android:layout_width="match_parent" | ||
android:layout_height="0dp" | ||
android:layout_weight="1" > | ||
<TextView | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:textAppearance="?android:attr/textAppearanceMedium" | ||
android:text="@string/category" | ||
android:id="@+id/textViewCategory" | ||
android:layout_centerVertical="true" | ||
android:layout_alignParentStart="true" /> | ||
<TextView | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:textAppearance="?android:attr/textAppearanceMedium" | ||
android:id="@+id/hyperlinkCategory" | ||
android:layout_centerVertical="true" | ||
android:layout_alignParentEnd="true" /> | ||
</RelativeLayout > | ||
<RelativeLayout android:layout_width="match_parent" | ||
android:layout_height="0dp" | ||
android:layout_weight="1" > | ||
<TextView | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:id="@+id/hyperlinkID" | ||
android:textAppearance="?android:attr/textAppearanceSmall" | ||
android:layout_centerVertical="true" | ||
android:layout_alignParentStart="true" /> | ||
<TextView | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:textAppearance="?android:attr/textAppearanceSmall" | ||
android:id="@+id/hyperlinkTimestamp" | ||
android:layout_centerVertical="true" | ||
android:layout_alignParentEnd="true" /> | ||
</RelativeLayout > | ||
</LinearLayout > |
Binary file not shown.
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 @@ | ||
#Wed Apr 10 15:27:10 PDT 2013 | ||
#Fri Sep 16 11:44:51 CEST 2016 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-bin.zip |