Updates style for searchactivity

This commit is contained in:
Denis 2015-02-02 18:02:21 +02:00
parent 30398fad48
commit f8b205b957
13 changed files with 61 additions and 26 deletions

View file

@ -4,8 +4,8 @@
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingBottom="5dp"
android:paddingLeft="8dp"
android:paddingRight="4dp"
android:paddingLeft="@dimen/search_content_padding"
android:paddingRight="@dimen/search_content_padding"
android:paddingTop="5dp">
<LinearLayout

View file

@ -1,6 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:custom="http://schemas.android.com/apk/res-auto"
android:paddingLeft="@dimen/search_content_padding"
android:paddingRight="@dimen/search_content_padding"
android:layout_width="fill_parent"
android:layout_height="fill_parent">

View file

@ -1,6 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:custom="http://schemas.android.com/apk/res-auto"
android:paddingLeft="@dimen/search_content_padding"
android:paddingRight="@dimen/search_content_padding"
android:layout_width="fill_parent"
android:layout_height="fill_parent">

View file

@ -8,14 +8,15 @@
android:id="@+id/LinearLayout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginRight="5dp"
android:paddingLeft="@dimen/search_content_padding"
android:paddingRight="@dimen/search_content_padding"
android:layout_marginTop="5dp">
<ProgressBar
android:id="@+id/ProgressBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="invisible"></ProgressBar>
android:visibility="invisible"/>
<EditText
android:id="@+id/SearchText"
@ -23,14 +24,14 @@
android:layout_height="wrap_content"
android:layout_weight="1"
android:hint="@string/hint_search_online"
android:text=""></EditText>
android:text=""/>
<Button
android:id="@+id/SearchButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minWidth="80dp"
android:text="@string/search_button"></Button>
android:text="@string/search_button"/>
</LinearLayout>
<ListView
@ -38,6 +39,6 @@
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1"
style="@style/OsmandListView"></ListView>
style="@style/OsmandListView"/>
</LinearLayout>

View file

@ -2,6 +2,8 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:paddingLeft="@dimen/search_content_padding"
android:paddingRight="@dimen/search_content_padding"
android:orientation="horizontal">
<TextView
@ -9,7 +11,6 @@
style="@style/ListText.Small"
android:layout_width="80dp"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:gravity="left" />
<TextView

View file

@ -0,0 +1,20 @@
<?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">
<ListView
android:id="@android:id/list"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
style="@style/OsmandListView"/>
<Button
android:id="@+id/clearAll"
android:layout_marginLeft="@dimen/search_content_padding"
android:layout_marginRight="@dimen/search_content_padding"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</LinearLayout>

View file

@ -2,6 +2,8 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingLeft="@dimen/search_content_padding"
android:paddingRight="@dimen/search_content_padding"
android:orientation="horizontal">
<TextView
@ -9,7 +11,6 @@
style="@style/ListText"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="3dp"
android:layout_marginRight="3dp"
android:layout_weight="1" />

View file

@ -3,6 +3,7 @@
android:id="@+id/RootLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<LinearLayout

View file

@ -2,14 +2,14 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingLeft="@dimen/search_content_padding"
android:paddingRight="@dimen/search_content_padding"
android:orientation="horizontal">
<ImageView
android:id="@+id/search_icon"
android:layout_width="25dp"
android:layout_height="fill_parent"
android:paddingLeft="2dp"
android:paddingRight="2dp"
android:paddingTop="2dp" />
<TextView

View file

@ -2,6 +2,8 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingLeft="@dimen/search_content_padding"
android:paddingRight="@dimen/search_content_padding"
android:orientation="horizontal">
<!-- <TextView android:id="@+id/distance_label" android:layout_marginLeft="5dp"
@ -21,7 +23,6 @@
android:background="?attr/reset_image"
android:contentDescription="@string/default_buttons_delete"
android:paddingLeft="2dp"
android:paddingRight="2dp"
android:paddingTop="2dp" />
</LinearLayout>

View file

@ -3,6 +3,8 @@
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingLeft="@dimen/search_content_padding"
android:paddingRight="@dimen/search_content_padding"
android:paddingBottom="5dp"
android:paddingTop="5dp">

View file

@ -22,6 +22,7 @@
<dimen name="abp__shadow_height">4dp</dimen>
<dimen name="dashFABMargin">0dp</dimen>
<dimen name="dash_parking_height">100dp</dimen>
<dimen name="search_content_padding">16dp</dimen>
<!-- TextSizes -->
<dimen name="showAllButtonTextSize">12sp</dimen>

View file

@ -22,9 +22,12 @@ import android.support.v4.app.FragmentActivity;
import android.text.Spannable;
import android.text.style.ForegroundColorSpan;
import android.view.View.OnClickListener;
import android.widget.AbsListView;
import android.widget.ActionMenuView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.TextView.BufferType;
@ -39,10 +42,21 @@ public class SearchHistoryFragment extends ListFragment implements SearchActivit
private HistoryAdapter historyAdapter;
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.search_history, container, false);
clearButton = (Button) view.findViewById(R.id.clearAll);
clearButton.setText(R.string.clear_all);
clearButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
helper.removeAll();
historyAdapter.clear();
clearButton.setVisibility(View.GONE);
}
});
return view;
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@ -53,17 +67,6 @@ public class SearchHistoryFragment extends ListFragment implements SearchActivit
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
historyAdapter = new HistoryAdapter(helper.getHistoryEntries());
clearButton = new Button(getActivity());
clearButton.setText(R.string.clear_all);
clearButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
helper.removeAll();
historyAdapter.clear();
clearButton.setVisibility(View.GONE);
}
});
getListView().addFooterView(clearButton);
setListAdapter(historyAdapter);
setHasOptionsMenu(true);
}