forked from upstream-mirrors/OpenTracks
Cleanup: properly name method (has side effect).
This commit is contained in:
@@ -3,6 +3,7 @@ package de.dennisguse.opentracks;
|
|||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
import de.dennisguse.opentracks.databinding.AboutBinding;
|
import de.dennisguse.opentracks.databinding.AboutBinding;
|
||||||
@@ -29,7 +30,8 @@ public class AboutActivity extends AbstractActivity {
|
|||||||
ViewUtils.makeClickableLinks(findViewById(android.R.id.content));
|
ViewUtils.makeClickableLinks(findViewById(android.R.id.content));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected View getRootView() {
|
@NonNull
|
||||||
|
protected View createRootView() {
|
||||||
viewBinding = AboutBinding.inflate(getLayoutInflater());
|
viewBinding = AboutBinding.inflate(getLayoutInflater());
|
||||||
return viewBinding.getRoot();
|
return viewBinding.getRoot();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ public abstract class AbstractActivity extends AppCompatActivity {
|
|||||||
// Set volume control stream for text to speech
|
// Set volume control stream for text to speech
|
||||||
setVolumeControlStream(TTSManager.AUDIO_STREAM);
|
setVolumeControlStream(TTSManager.AUDIO_STREAM);
|
||||||
|
|
||||||
View rootView = getRootView();
|
View rootView = createRootView();
|
||||||
setContentView(rootView);
|
setContentView(rootView);
|
||||||
|
|
||||||
apply_insets(rootView);
|
apply_insets(rootView);
|
||||||
@@ -93,5 +93,6 @@ public abstract class AbstractActivity extends AppCompatActivity {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected abstract View getRootView();
|
@NonNull
|
||||||
|
protected abstract View createRootView();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package de.dennisguse.opentracks;
|
|||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
import de.dennisguse.opentracks.databinding.HelpBinding;
|
import de.dennisguse.opentracks.databinding.HelpBinding;
|
||||||
@@ -19,8 +20,9 @@ public class HelpActivity extends AbstractActivity {
|
|||||||
ViewUtils.makeClickableLinks(findViewById(android.R.id.content));
|
ViewUtils.makeClickableLinks(findViewById(android.R.id.content));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
protected View getRootView() {
|
protected View createRootView() {
|
||||||
helpBinding = HelpBinding.inflate(getLayoutInflater());
|
helpBinding = HelpBinding.inflate(getLayoutInflater());
|
||||||
return helpBinding.getRoot();
|
return helpBinding.getRoot();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ import android.view.Menu;
|
|||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
import java.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
@@ -28,8 +30,9 @@ public class ShowErrorActivity extends AbstractActivity {
|
|||||||
setSupportActionBar(viewBinding.bottomAppBarLayout.bottomAppBar);
|
setSupportActionBar(viewBinding.bottomAppBarLayout.bottomAppBar);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
protected View getRootView() {
|
protected View createRootView() {
|
||||||
viewBinding = ActivityShowErrorBinding.inflate(getLayoutInflater());
|
viewBinding = ActivityShowErrorBinding.inflate(getLayoutInflater());
|
||||||
return viewBinding.getRoot();
|
return viewBinding.getRoot();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -115,8 +115,9 @@ public class TrackEditActivity extends AbstractActivity implements ChooseActivit
|
|||||||
outState.putSerializable(ICON_VALUE_KEY, activityType);
|
outState.putSerializable(ICON_VALUE_KEY, activityType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
protected View getRootView() {
|
protected View createRootView() {
|
||||||
viewBinding = TrackEditBinding.inflate(getLayoutInflater());
|
viewBinding = TrackEditBinding.inflate(getLayoutInflater());
|
||||||
return viewBinding.getRoot();
|
return viewBinding.getRoot();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ import android.view.MenuItem;
|
|||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.appcompat.content.res.AppCompatResources;
|
import androidx.appcompat.content.res.AppCompatResources;
|
||||||
import androidx.core.content.ContextCompat;
|
import androidx.core.content.ContextCompat;
|
||||||
@@ -242,8 +243,9 @@ public class TrackListActivity extends AbstractTrackDeleteActivity implements Co
|
|||||||
adapter = null;
|
adapter = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
protected View getRootView() {
|
protected View createRootView() {
|
||||||
viewBinding = TrackListBinding.inflate(getLayoutInflater());
|
viewBinding = TrackListBinding.inflate(getLayoutInflater());
|
||||||
|
|
||||||
viewBinding.trackListSearchView.getEditText().setOnEditorActionListener((v, actionId, event) -> {
|
viewBinding.trackListSearchView.getEditText().setOnEditorActionListener((v, actionId, event) -> {
|
||||||
|
|||||||
@@ -136,8 +136,9 @@ public class TrackRecordedActivity extends AbstractTrackDeleteActivity implement
|
|||||||
outState.putInt(CURRENT_TAB_TAG_KEY, viewBinding.trackDetailActivityViewPager.getCurrentItem());
|
outState.putInt(CURRENT_TAB_TAG_KEY, viewBinding.trackDetailActivityViewPager.getCurrentItem());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
protected View getRootView() {
|
protected View createRootView() {
|
||||||
viewBinding = TrackRecordedBinding.inflate(getLayoutInflater());
|
viewBinding = TrackRecordedBinding.inflate(getLayoutInflater());
|
||||||
return viewBinding.getRoot();
|
return viewBinding.getRoot();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -250,8 +250,9 @@ public class TrackRecordingActivity extends AbstractActivity implements ChooseAc
|
|||||||
trackRecordingServiceConnection = null;
|
trackRecordingServiceConnection = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
protected View getRootView() {
|
protected View createRootView() {
|
||||||
viewBinding = TrackRecordingBinding.inflate(getLayoutInflater());
|
viewBinding = TrackRecordingBinding.inflate(getLayoutInflater());
|
||||||
return viewBinding.getRoot();
|
return viewBinding.getRoot();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ import android.util.Pair;
|
|||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.ArrayAdapter;
|
import android.widget.ArrayAdapter;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
import de.dennisguse.opentracks.data.ContentProviderUtils;
|
import de.dennisguse.opentracks.data.ContentProviderUtils;
|
||||||
import de.dennisguse.opentracks.data.models.ActivityType;
|
import de.dennisguse.opentracks.data.models.ActivityType;
|
||||||
import de.dennisguse.opentracks.data.models.DistanceFormatter;
|
import de.dennisguse.opentracks.data.models.DistanceFormatter;
|
||||||
@@ -110,8 +112,9 @@ public class TrackStoppedActivity extends AbstractTrackDeleteActivity implements
|
|||||||
contentProviderUtils);
|
contentProviderUtils);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
protected View getRootView() {
|
protected View createRootView() {
|
||||||
viewBinding = TrackStoppedBinding.inflate(getLayoutInflater());
|
viewBinding = TrackStoppedBinding.inflate(getLayoutInflater());
|
||||||
return viewBinding.getRoot();
|
return viewBinding.getRoot();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,8 +47,9 @@ public class IntroductionActivity extends AbstractActivity {
|
|||||||
viewBinding.introductionViewPager.setUserInputEnabled(false);
|
viewBinding.introductionViewPager.setUserInputEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
protected View getRootView() {
|
protected View createRootView() {
|
||||||
viewBinding = IntroductionBinding.inflate(getLayoutInflater());
|
viewBinding = IntroductionBinding.inflate(getLayoutInflater());
|
||||||
return viewBinding.getRoot();
|
return viewBinding.getRoot();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -72,8 +72,9 @@ public class SettingsActivity extends AbstractActivity implements ChooseActivity
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
protected View getRootView() {
|
protected View createRootView() {
|
||||||
viewBinding = SettingsBinding.inflate(getLayoutInflater());
|
viewBinding = SettingsBinding.inflate(getLayoutInflater());
|
||||||
return viewBinding.getRoot();
|
return viewBinding.getRoot();
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-1
@@ -116,8 +116,9 @@ public class SettingsCustomLayoutEditActivity extends AbstractActivity implement
|
|||||||
recordingLayoutFieldsVisible = null;
|
recordingLayoutFieldsVisible = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
protected View getRootView() {
|
protected View createRootView() {
|
||||||
viewBinding = ActivitySettingsCustomLayoutBinding.inflate(getLayoutInflater());
|
viewBinding = ActivitySettingsCustomLayoutBinding.inflate(getLayoutInflater());
|
||||||
return viewBinding.getRoot();
|
return viewBinding.getRoot();
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-1
@@ -108,8 +108,9 @@ public class SettingsCustomLayoutListActivity extends AbstractActivity implement
|
|||||||
adapter.reloadLayouts();
|
adapter.reloadLayouts();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
protected View getRootView() {
|
protected View createRootView() {
|
||||||
PreferencesUtils.getCustomLayout();
|
PreferencesUtils.getCustomLayout();
|
||||||
viewBinding = ActivitySettingsCustomLayoutListBinding.inflate(getLayoutInflater());
|
viewBinding = ActivitySettingsCustomLayoutListBinding.inflate(getLayoutInflater());
|
||||||
return viewBinding.getRoot();
|
return viewBinding.getRoot();
|
||||||
|
|||||||
+2
-1
@@ -83,8 +83,9 @@ public class AggregatedStatisticsActivity extends AbstractActivity implements Fi
|
|||||||
outState.putBoolean(STATE_ARE_FILTERS_APPLIED, areFiltersApplied);
|
outState.putBoolean(STATE_ARE_FILTERS_APPLIED, areFiltersApplied);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
protected View getRootView() {
|
protected View createRootView() {
|
||||||
viewBinding = AggregatedStatsBinding.inflate(getLayoutInflater());
|
viewBinding = AggregatedStatsBinding.inflate(getLayoutInflater());
|
||||||
return viewBinding.getRoot();
|
return viewBinding.getRoot();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -110,8 +110,9 @@ public class MarkerDetailActivity extends AbstractActivity implements DeleteMark
|
|||||||
setSupportActionBar(viewBinding.bottomAppBarLayout.bottomAppBar);
|
setSupportActionBar(viewBinding.bottomAppBarLayout.bottomAppBar);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
protected View getRootView() {
|
protected View createRootView() {
|
||||||
viewBinding = MarkerDetailActivityBinding.inflate(getLayoutInflater());
|
viewBinding = MarkerDetailActivityBinding.inflate(getLayoutInflater());
|
||||||
return viewBinding.getRoot();
|
return viewBinding.getRoot();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -85,8 +85,9 @@ public class MarkerEditActivity extends AbstractActivity {
|
|||||||
// UI elements
|
// UI elements
|
||||||
private MarkerEditBinding viewBinding;
|
private MarkerEditBinding viewBinding;
|
||||||
|
|
||||||
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
protected View getRootView() {
|
protected View createRootView() {
|
||||||
viewBinding = MarkerEditBinding.inflate(getLayoutInflater());
|
viewBinding = MarkerEditBinding.inflate(getLayoutInflater());
|
||||||
return viewBinding.getRoot();
|
return viewBinding.getRoot();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -145,8 +145,9 @@ public class MarkerListActivity extends AbstractActivity implements DeleteMarker
|
|||||||
contentProviderUtils = null;
|
contentProviderUtils = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
protected View getRootView() {
|
protected View createRootView() {
|
||||||
viewBinding = MarkerListBinding.inflate(getLayoutInflater());
|
viewBinding = MarkerListBinding.inflate(getLayoutInflater());
|
||||||
|
|
||||||
viewBinding.markerListSearchView.getEditText().setOnEditorActionListener((v, actionId, event) -> {
|
viewBinding.markerListSearchView.getEditText().setOnEditorActionListener((v, actionId, event) -> {
|
||||||
|
|||||||
Reference in New Issue
Block a user