FAB added to history view
This commit is contained in:
@@ -97,12 +97,15 @@
|
||||
<orderEntry type="library" exported="" name="jscl-1.0.8" level="project" />
|
||||
<orderEntry type="library" exported="" name="android-common-views-1.1.18" level="project" />
|
||||
<orderEntry type="library" exported="" name="stax-1.2.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="library-2.4.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="android-common-menus-1.1.18" level="project" />
|
||||
<orderEntry type="library" exported="" name="recyclerview-v7-21.0.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="common-security-1.0.7" level="project" />
|
||||
<orderEntry type="library" exported="" name="checkout-0.6.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="android-common-core-1.1.18" level="project" />
|
||||
<orderEntry type="library" exported="" name="common-msg-1.0.5" level="project" />
|
||||
<orderEntry type="library" exported="" name="android-common-other-1.1.18" level="project" />
|
||||
<orderEntry type="library" exported="" name="floatingactionbutton-1.1.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="android-common-preferences-1.1.18" level="project" />
|
||||
<orderEntry type="library" exported="" name="support-annotations-21.0.3" level="project" />
|
||||
<orderEntry type="library" exported="" name="android-common-lists-1.1.18" level="project" />
|
||||
|
@@ -71,7 +71,7 @@ dependencies {
|
||||
compile 'org.solovyev.android:checkout:0.6.0@aar'
|
||||
compile 'com.actionbarsherlock:actionbarsherlock:4.4.0@aar'
|
||||
compile 'com.google.android.gms:play-services:6.5.87@aar'
|
||||
|
||||
compile 'com.melnykov:floatingactionbutton:1.1.0'
|
||||
}
|
||||
|
||||
task androidJavadocs(type: Javadoc) {
|
||||
|
@@ -35,12 +35,11 @@ import android.view.ViewGroup;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.ListView;
|
||||
|
||||
import com.actionbarsherlock.app.SherlockListFragment;
|
||||
import com.actionbarsherlock.view.Menu;
|
||||
import com.actionbarsherlock.view.MenuInflater;
|
||||
import com.actionbarsherlock.view.MenuItem;
|
||||
|
||||
import com.melnykov.fab.FloatingActionButton;
|
||||
import org.solovyev.android.calculator.*;
|
||||
import org.solovyev.android.calculator.R;
|
||||
import org.solovyev.android.calculator.jscl.JsclOperation;
|
||||
@@ -55,7 +54,6 @@ import org.solovyev.common.text.Strings;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
@@ -149,6 +147,15 @@ public abstract class BaseHistoryFragment extends SherlockListFragment implement
|
||||
final ListView lv = getListView();
|
||||
lv.setTextFilterEnabled(true);
|
||||
|
||||
final FloatingActionButton fab = (FloatingActionButton) root.findViewById(R.id.fab);
|
||||
fab.attachToListView(lv);
|
||||
fab.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Locator.getInstance().getCalculator().fireCalculatorEvent(clear_history_requested, null);
|
||||
}
|
||||
});
|
||||
|
||||
lv.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||
public void onItemClick(final AdapterView<?> parent,
|
||||
final View view,
|
||||
@@ -361,13 +368,6 @@ public abstract class BaseHistoryFragment extends SherlockListFragment implement
|
||||
|
||||
private static enum HistoryMenu implements IdentifiableMenuItem<MenuItem> {
|
||||
|
||||
clear_history(R.id.menu_history_clear_history) {
|
||||
@Override
|
||||
public void onClick(@Nonnull MenuItem data, @Nonnull Context context) {
|
||||
Locator.getInstance().getCalculator().fireCalculatorEvent(clear_history_requested, null);
|
||||
}
|
||||
},
|
||||
|
||||
toggle_datetime(R.id.menu_history_toggle_datetime) {
|
||||
@Override
|
||||
public void onClick(@Nonnull MenuItem data, @Nonnull Context context) {
|
||||
|
@@ -99,7 +99,7 @@ public class HistoryArrayAdapter extends ArrayAdapter<CalculatorHistoryState> {
|
||||
}
|
||||
});
|
||||
} else {
|
||||
status.setVisibility(INVISIBLE);
|
||||
status.setVisibility(GONE);
|
||||
status.setOnClickListener(null);
|
||||
}
|
||||
}
|
||||
|
BIN
android-app/src/main/res/drawable-hdpi/ic_delete_white_36dp.png
Normal file
BIN
android-app/src/main/res/drawable-hdpi/ic_delete_white_36dp.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 345 B |
BIN
android-app/src/main/res/drawable-mdpi/ic_delete_white_36dp.png
Normal file
BIN
android-app/src/main/res/drawable-mdpi/ic_delete_white_36dp.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 246 B |
BIN
android-app/src/main/res/drawable-xhdpi/ic_delete_white_36dp.png
Normal file
BIN
android-app/src/main/res/drawable-xhdpi/ic_delete_white_36dp.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 338 B |
Binary file not shown.
After Width: | Height: | Size: 456 B |
@@ -23,19 +23,34 @@
|
||||
-->
|
||||
|
||||
<LinearLayout xmlns:a="http://schemas.android.com/apk/res/android"
|
||||
a:id="@+id/main_fragment_layout"
|
||||
style="?cpp_fragment_layout_style"
|
||||
a:layout_width="match_parent"
|
||||
a:layout_height="match_parent">
|
||||
xmlns:fab="http://schemas.android.com/apk/res-auto"
|
||||
a:id="@+id/main_fragment_layout"
|
||||
style="?cpp_fragment_layout_style"
|
||||
a:layout_width="match_parent"
|
||||
a:layout_height="match_parent">
|
||||
|
||||
<TextView
|
||||
a:id="@+id/fragment_title"
|
||||
a:id="@+id/fragment_title"
|
||||
a:layout_height="wrap_content"
|
||||
a:layout_width="match_parent"
|
||||
style="?cpp_fragment_title_style" />
|
||||
|
||||
<include layout="@layout/ad" />
|
||||
|
||||
<FrameLayout
|
||||
a:layout_width="match_parent"
|
||||
a:layout_height="match_parent">
|
||||
|
||||
<ListView style="?cpp_fragment_list_view_style" />
|
||||
|
||||
<com.melnykov.fab.FloatingActionButton
|
||||
a:id="@+id/fab"
|
||||
a:layout_width="wrap_content"
|
||||
a:layout_height="wrap_content"
|
||||
a:layout_width="match_parent"
|
||||
style="?cpp_fragment_title_style"/>
|
||||
|
||||
<include layout="@layout/ad"/>
|
||||
|
||||
<ListView style="?cpp_fragment_list_view_style"/>
|
||||
|
||||
a:layout_gravity="bottom|right"
|
||||
a:layout_margin="16dp"
|
||||
a:src="@drawable/ic_delete_white_36dp"
|
||||
fab:fab_colorNormal="#393939"
|
||||
fab:fab_colorRipple="#40000000" />
|
||||
</FrameLayout>
|
||||
</LinearLayout>
|
@@ -48,12 +48,11 @@
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView a:id="@+id/history_item_status_icon"
|
||||
a:layout_gravity="center_vertical"
|
||||
a:layout_gravity="center_vertical|right"
|
||||
a:scaleType="centerInside"
|
||||
a:padding="6dp"
|
||||
a:src="@drawable/ic_save_grey600_48dp"
|
||||
a:visibility="invisible"
|
||||
a:layout_width="wrap_content"
|
||||
a:layout_height="match_parent"/>
|
||||
a:visibility="gone"
|
||||
a:layout_width="30dp"
|
||||
a:layout_height="30dp"/>
|
||||
|
||||
</LinearLayout>
|
@@ -36,10 +36,4 @@
|
||||
a:title="@string/c_toggle_datetime"
|
||||
a:showAsAction="always"/>
|
||||
|
||||
<item
|
||||
a:id="@+id/menu_history_clear_history"
|
||||
a:icon="@drawable/ic_delete_grey600_48dp"
|
||||
a:title="@string/c_clear_history"
|
||||
a:showAsAction="always"/>
|
||||
|
||||
</menu>
|
@@ -22,9 +22,12 @@
|
||||
|
||||
<resources>
|
||||
|
||||
<style name="history_time" parent="math_entity_description"/>
|
||||
<style name="history_time" parent="math_entity_description" />
|
||||
|
||||
<style name="history_item" parent="math_entity_text"/>
|
||||
<style name="history_item" parent="math_entity_text">
|
||||
<item name="android:maxLines">2</item>
|
||||
<item name="android:ellipsize">end</item>
|
||||
</style>
|
||||
|
||||
<style name="history_item_label" parent="math_entity_description">
|
||||
<item name="android:textStyle">bold</item>
|
||||
|
@@ -60,7 +60,7 @@
|
||||
|
||||
<style name="cpp_default_fragment_list_view_style">
|
||||
<item name="android:id">@android:id/list</item>
|
||||
<item name="android:dividerHeight">1dp</item>
|
||||
<item name="android:dividerHeight">1px</item>
|
||||
<item name="android:divider">@color/cpp_list_divider</item>
|
||||
<item name="android:cacheColorHint">@android:color/transparent</item>
|
||||
<item name="android:layout_height">match_parent</item>
|
||||
|
Reference in New Issue
Block a user