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

Added FAB in Help Section to Scroll #925

Open
wants to merge 7 commits into
base: gsoc2022
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
6 changes: 6 additions & 0 deletions org.envirocar.app/res/drawable/ic_scroll_up.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<vector android:height="24dp" android:tint="#FFFFFF"
android:fillColor="@android:color/white"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M4,12l1.41,1.41L11,7.83V20h2V7.83l5.58,5.59L20,12l-8,-8 -8,8z"/>
</vector>
13 changes: 13 additions & 0 deletions org.envirocar.app/res/layout/activity_help_layout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<androidx.core.widget.NestedScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/helpScroll"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipToPadding="false"
Expand Down Expand Up @@ -286,5 +287,17 @@
style="@style/enviroCar.Help.content"
android:autoLink="email"
android:text="@string/help_content_6"/>

<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/topScroll"
android:tint="#8CBF3F"
android:backgroundTint="#8CBF3F"
android:src="@drawable/ic_scroll_up"
android:layout_marginStart="220dp"
android:layout_marginTop="20dp"
android:layout_marginBottom="20dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>

</LinearLayout>
</androidx.core.widget.NestedScrollView>
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,13 @@
import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.core.widget.NestedScrollView;

import android.view.MenuItem;
import android.view.View;
import android.widget.ScrollView;

import com.google.android.material.floatingactionbutton.FloatingActionButton;

import org.envirocar.app.R;

Expand All @@ -38,12 +44,26 @@ public class HelpActivity extends AppCompatActivity {
@BindView(R.id.activity_help_layout_general_toolbar)
protected Toolbar toolbar;

NestedScrollView nestedScrollView;
FloatingActionButton floatingActionButton;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

setContentView(R.layout.activity_help_layout_general);

nestedScrollView = findViewById(R.id.helpScroll);
floatingActionButton = findViewById(R.id.topScroll);

floatingActionButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
nestedScrollView.fullScroll(NestedScrollView.FOCUS_UP);
floatingActionButton.show();
}
});

// Inject views
ButterKnife.bind(this);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* @author dewall
*/
public class EnviroCarService {
public static final String BASE_URL = "https://envirocar.org/api/dev/";
public static final String BASE_URL = "https://envirocar.org/api/stable/";

protected static UserService userService;

Expand Down