Skip to content

Commit

Permalink
add hint for input and add "clear history" button
Browse files Browse the repository at this point in the history
  • Loading branch information
autoandshare committed Apr 19, 2021
1 parent e3974e5 commit 9e2cf2a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,14 @@ public void onItemClick(AdapterView<?> parent, View view, int position, long id)
urlText.setText(listItems.get(position));
}
});

view.findViewById(R.id.clearUrlList).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
adapter.clear();
}
});

}

private void addOrReplace(String url) {
Expand Down
11 changes: 9 additions & 2 deletions src/main/res/layout/fragment_stream.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@
android:layout_height="match_parent"
android:orientation="vertical">


<EditText
android:id="@+id/streamUrl"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="2" />
android:maxLines="2"
android:hint="https://..."
/>

<LinearLayout
android:layout_width="match_parent"
Expand All @@ -24,6 +25,12 @@

</LinearLayout>

<Button
android:id="@+id/clearUrlList"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Clear History" />

<ListView
android:id="@+id/streamUrlList"
android:layout_width="match_parent"
Expand Down

0 comments on commit 9e2cf2a

Please sign in to comment.