Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Making Start Counting button more obvious #161

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/main/java/de/j4velin/pedometer/ui/Fragment_Overview.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;

import org.eazegraph.lib.charts.BarChart;
import org.eazegraph.lib.charts.PieChart;
Expand All @@ -62,7 +64,7 @@ public class Fragment_Overview extends Fragment implements SensorEventListener {
private TextView stepsView, totalView, averageView;
private PieModel sliceGoal, sliceCurrent;
private PieChart pg;

ImageView imageViewFab;
private int todayOffset, total_start, goal, since_boot, total_days;
public final static NumberFormat formatter = NumberFormat.getInstance(Locale.getDefault());
private boolean showSteps = true;
Expand All @@ -84,6 +86,7 @@ public View onCreateView(final LayoutInflater inflater, final ViewGroup containe
final View v = inflater.inflate(R.layout.fragment_overview, null);
stepsView = (TextView) v.findViewById(R.id.steps);
totalView = (TextView) v.findViewById(R.id.total);
imageViewFab = (ImageView) v.findViewById(R.id.fab);
averageView = (TextView) v.findViewById(R.id.average);

pg = (PieChart) v.findViewById(R.id.graph);
Expand All @@ -104,6 +107,13 @@ public void onClick(final View view) {
}
});

imageViewFab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Dialog_Split.getDialog(getActivity(),
total_start + Math.max(todayOffset + since_boot, 0)).show();
}
});
pg.setDrawValueInPie(false);
pg.setUsePieRotation(true);
pg.startAnimation();
Expand Down
Binary file added src/main/res/drawable-hdpi/fab.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/main/res/drawable-mdpi/fab.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/main/res/drawable-xhdpi/fab.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/main/res/drawable-xxhdpi/fab.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 9 additions & 1 deletion src/main/res/layout-land/fragment_overview.xml
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,13 @@
android:layout_toRightOf="@+id/graph"
eaze:egLegendHeight="35dp"
eaze:egShowValues="true"/>

<ImageView
android:layout_width="wrap_content"
android:src="@drawable/fab"
android:id="@+id/fab"
android:layout_margin="30dp"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_height="wrap_content"
android:contentDescription="@string/todo" />
</RelativeLayout>
10 changes: 10 additions & 0 deletions src/main/res/layout/fragment_overview.xml
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,14 @@
eaze:egLegendHeight="35dp"
eaze:egShowValues="true"/>

<ImageView
android:layout_width="wrap_content"
android:src="@drawable/fab"
android:id="@+id/fab"
android:layout_margin="30dp"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_height="wrap_content"
android:contentDescription="@string/todo" />

</RelativeLayout>
1 change: 1 addition & 0 deletions src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,5 @@
<string name="no_sensor_explain">This app requires a dedicated hardware step sensor - which your device does not have. This app won\'t run on your device.</string>
<string name="permission_external_storage">No permission to access external storage</string>
<string name="notification_settings">Notification settings</string>
<string name="todo">TODO</string>
</resources>