forked from upstream-mirrors/OpenTracks
Use ViewBinding for activities.
This commit is contained in:
@@ -2,38 +2,35 @@ package de.dennisguse.opentracks;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.Menu;
|
||||
import android.widget.TextView;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import de.dennisguse.opentracks.databinding.AboutBinding;
|
||||
import de.dennisguse.opentracks.util.SystemUtils;
|
||||
import de.dennisguse.opentracks.util.ViewUtils;
|
||||
|
||||
public class AboutActivity extends AbstractActivity {
|
||||
|
||||
private AboutBinding viewBinding;
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
setTitle(getString(R.string.about_preference_title));
|
||||
|
||||
TextView textDescription = findViewById(R.id.about_text_description);
|
||||
textDescription.setText(getString(R.string.about_description));
|
||||
|
||||
TextView textVersionName = findViewById(R.id.about_text_version_name);
|
||||
textVersionName.setText(getString(R.string.about_version_name, SystemUtils.getAppVersionName(this)));
|
||||
|
||||
TextView textVersionCode = findViewById(R.id.about_text_version_code);
|
||||
textVersionCode.setText(getString(R.string.about_version_code, SystemUtils.getAppVersionCode(this)));
|
||||
|
||||
TextView textURL = findViewById(R.id.about_app_url);
|
||||
textURL.setText(getString(R.string.about_url, getString(R.string.app_web_url)));
|
||||
viewBinding.aboutTextDescription.setText(getString(R.string.about_description));
|
||||
viewBinding.aboutTextVersionName.setText(getString(R.string.about_version_name, SystemUtils.getAppVersionName(this)));
|
||||
viewBinding.aboutTextVersionCode.setText(getString(R.string.about_version_code, SystemUtils.getAppVersionCode(this)));
|
||||
viewBinding.aboutAppUrl.setText(getString(R.string.about_url, getString(R.string.app_web_url)));
|
||||
|
||||
ViewUtils.makeClickableLinks(findViewById(android.R.id.content));
|
||||
}
|
||||
|
||||
protected int getLayoutResId() {
|
||||
return R.layout.about;
|
||||
protected View getRootView() {
|
||||
viewBinding = AboutBinding.inflate(getLayoutInflater());
|
||||
return viewBinding.getRoot();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
package de.dennisguse.opentracks;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
@@ -35,14 +36,11 @@ public abstract class AbstractActivity extends AppCompatActivity {
|
||||
// Set volume control stream for text to speech
|
||||
setVolumeControlStream(TTSUtils.getTTSStream());
|
||||
|
||||
setContentView(getLayoutResId());
|
||||
setContentView(getRootView());
|
||||
|
||||
Toolbar toolbar = findViewById(R.id.toolbar);
|
||||
setSupportActionBar(toolbar);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the layout resource id.
|
||||
*/
|
||||
protected abstract int getLayoutResId();
|
||||
protected abstract View getRootView();
|
||||
}
|
||||
|
||||
@@ -1,37 +1,39 @@
|
||||
package de.dennisguse.opentracks;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.widget.ListView;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
|
||||
import de.dennisguse.opentracks.adapters.AggregatedStatisticsAdapter;
|
||||
import de.dennisguse.opentracks.databinding.AggregatedStatsBinding;
|
||||
import de.dennisguse.opentracks.viewmodels.AggregatedStatisticsModel;
|
||||
|
||||
public class AggregatedStatisticsActivity extends AbstractActivity {
|
||||
|
||||
private ListView listView;
|
||||
private AggregatedStatsBinding viewBinding;
|
||||
|
||||
private AggregatedStatisticsAdapter adapter;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
listView = findViewById(R.id.aggregated_stats_list);
|
||||
listView.setEmptyView(findViewById(R.id.aggregated_stats_empty_view));
|
||||
viewBinding.aggregatedStatsList.setEmptyView(viewBinding.aggregatedStatsEmptyView);
|
||||
|
||||
final AggregatedStatisticsModel viewModel = new ViewModelProvider(this).get(AggregatedStatisticsModel.class);
|
||||
viewModel.getAggregatedStats().observe(this, aggregatedStatistics -> {
|
||||
if (aggregatedStatistics != null) {
|
||||
adapter = new AggregatedStatisticsAdapter(this, aggregatedStatistics);
|
||||
listView.setAdapter(adapter);
|
||||
viewBinding.aggregatedStatsList.setAdapter(adapter);
|
||||
}
|
||||
adapter.notifyDataSetChanged();
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutResId() {
|
||||
return R.layout.aggregated_stats;
|
||||
protected View getRootView() {
|
||||
viewBinding = AggregatedStatsBinding.inflate(getLayoutInflater());
|
||||
return viewBinding.getRoot();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
package de.dennisguse.opentracks;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import de.dennisguse.opentracks.databinding.HelpBinding;
|
||||
import de.dennisguse.opentracks.util.ViewUtils;
|
||||
|
||||
public class HelpActivity extends AbstractActivity {
|
||||
@@ -15,7 +17,7 @@ public class HelpActivity extends AbstractActivity {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutResId() {
|
||||
return R.layout.help;
|
||||
protected View getRootView() {
|
||||
return HelpBinding.inflate(getLayoutInflater()).getRoot();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ package de.dennisguse.opentracks;
|
||||
import android.database.Cursor;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
@@ -32,6 +33,7 @@ import java.util.List;
|
||||
|
||||
import de.dennisguse.opentracks.content.data.Marker;
|
||||
import de.dennisguse.opentracks.content.provider.ContentProviderUtils;
|
||||
import de.dennisguse.opentracks.databinding.MarkerDetailActivityBinding;
|
||||
import de.dennisguse.opentracks.fragments.DeleteMarkerDialogFragment.DeleteMarkerCaller;
|
||||
import de.dennisguse.opentracks.fragments.MarkerDetailFragment;
|
||||
|
||||
@@ -48,6 +50,8 @@ public class MarkerDetailActivity extends AbstractActivity implements DeleteMark
|
||||
|
||||
private static final String TAG = MarkerDetailActivity.class.getSimpleName();
|
||||
|
||||
private MarkerDetailActivityBinding viewBinding;
|
||||
|
||||
private List<Marker.Id> markerIds;
|
||||
|
||||
@Override
|
||||
@@ -82,10 +86,9 @@ public class MarkerDetailActivity extends AbstractActivity implements DeleteMark
|
||||
}
|
||||
}
|
||||
|
||||
final ViewPager viewPager = findViewById(R.id.maker_detail_activity_view_pager);
|
||||
final MarkerDetailPagerAdapter markerAdapter = new MarkerDetailPagerAdapter(getSupportFragmentManager());
|
||||
viewPager.setAdapter(markerAdapter);
|
||||
viewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
|
||||
viewBinding.makerDetailActivityViewPager.setAdapter(markerAdapter);
|
||||
viewBinding.makerDetailActivityViewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
|
||||
|
||||
@Override
|
||||
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
|
||||
@@ -100,12 +103,13 @@ public class MarkerDetailActivity extends AbstractActivity implements DeleteMark
|
||||
public void onPageScrollStateChanged(int state) {
|
||||
}
|
||||
});
|
||||
viewPager.setCurrentItem(markerIndex == -1 ? 0 : markerIndex);
|
||||
viewBinding.makerDetailActivityViewPager.setCurrentItem(markerIndex == -1 ? 0 : markerIndex);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutResId() {
|
||||
return R.layout.marker_detail_activity;
|
||||
protected View getRootView() {
|
||||
viewBinding = MarkerDetailActivityBinding.inflate(getLayoutInflater());
|
||||
return viewBinding.getRoot();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -30,15 +30,10 @@ import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.AutoCompleteTextView;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.google.android.material.textfield.TextInputEditText;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileDescriptor;
|
||||
import java.io.IOException;
|
||||
@@ -46,6 +41,7 @@ import java.io.IOException;
|
||||
import de.dennisguse.opentracks.content.data.Marker;
|
||||
import de.dennisguse.opentracks.content.data.Track;
|
||||
import de.dennisguse.opentracks.content.provider.ContentProviderUtils;
|
||||
import de.dennisguse.opentracks.databinding.MarkerEditBinding;
|
||||
import de.dennisguse.opentracks.services.TrackRecordingServiceConnection;
|
||||
import de.dennisguse.opentracks.util.FileUtils;
|
||||
import de.dennisguse.opentracks.util.IntentUtils;
|
||||
@@ -67,7 +63,7 @@ public class MarkerEditActivity extends AbstractActivity {
|
||||
|
||||
private static final String TAG = MarkerEditActivity.class.getSimpleName();
|
||||
private Track.Id trackId;
|
||||
private TrackRecordingServiceConnection trackRecordingServiceConnection = new TrackRecordingServiceConnection();
|
||||
private final TrackRecordingServiceConnection trackRecordingServiceConnection = new TrackRecordingServiceConnection();
|
||||
private Marker marker;
|
||||
|
||||
private MenuItem insertPhotoMenuItem;
|
||||
@@ -77,11 +73,7 @@ public class MarkerEditActivity extends AbstractActivity {
|
||||
private boolean hasCamera;
|
||||
|
||||
// UI elements
|
||||
private TextInputEditText markerName;
|
||||
private AutoCompleteTextView markerType;
|
||||
private TextInputEditText markerDescription;
|
||||
private ImageView markerPhoto;
|
||||
private ImageView markerDeletePhotoBtn;
|
||||
private MarkerEditBinding viewBinding;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
@@ -93,32 +85,24 @@ public class MarkerEditActivity extends AbstractActivity {
|
||||
hasCamera = getPackageManager().hasSystemFeature(PackageManager.FEATURE_CAMERA_ANY);
|
||||
|
||||
// Setup UI elements
|
||||
markerName = findViewById(R.id.marker_edit_name);
|
||||
markerType = findViewById(R.id.marker_edit_marker_type);
|
||||
ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this, R.array.marker_types, android.R.layout.simple_dropdown_item_1line);
|
||||
markerType.setAdapter(adapter);
|
||||
markerDescription = findViewById(R.id.marker_edit_description);
|
||||
markerPhoto = findViewById(R.id.marker_edit_photo);
|
||||
|
||||
markerDeletePhotoBtn = findViewById(R.id.marker_edit_photo_delete);
|
||||
markerDeletePhotoBtn.setOnClickListener(v -> {
|
||||
viewBinding.markerEditMarkerType.setAdapter(adapter);
|
||||
viewBinding.markerEditPhotoDelete.setOnClickListener(v -> {
|
||||
if (marker != null && marker.hasPhoto()) {
|
||||
marker.setPhotoUrl(null);
|
||||
}
|
||||
markerPhoto.setImageBitmap(null);
|
||||
viewBinding.markerEditPhoto.setImageBitmap(null);
|
||||
photoUri = null;
|
||||
hideAndShowOptions();
|
||||
});
|
||||
|
||||
Button cancel = findViewById(R.id.marker_edit_cancel);
|
||||
cancel.setOnClickListener(v -> finish());
|
||||
viewBinding.markerEditCancel.setOnClickListener(v -> finish());
|
||||
|
||||
final boolean isNewMarker = markerId == null;
|
||||
|
||||
setTitle(isNewMarker ? R.string.menu_insert_marker : R.string.menu_edit);
|
||||
Button done = findViewById(R.id.marker_edit_done);
|
||||
done.setText(isNewMarker ? R.string.generic_add : R.string.generic_save);
|
||||
done.setOnClickListener(v -> {
|
||||
viewBinding.markerEditDone.setText(isNewMarker ? R.string.generic_add : R.string.generic_save);
|
||||
viewBinding.markerEditDone.setOnClickListener(v -> {
|
||||
if (isNewMarker) {
|
||||
addMarker();
|
||||
} else {
|
||||
@@ -132,10 +116,10 @@ public class MarkerEditActivity extends AbstractActivity {
|
||||
if (nextMarkerNumber == -1) {
|
||||
nextMarkerNumber = 0;
|
||||
}
|
||||
markerName.setText(getString(R.string.marker_name_format, nextMarkerNumber));
|
||||
markerName.selectAll();
|
||||
markerType.setText("");
|
||||
markerDescription.setText("");
|
||||
viewBinding.markerEditName.setText(getString(R.string.marker_name_format, nextMarkerNumber));
|
||||
viewBinding.markerEditName.selectAll();
|
||||
viewBinding.markerEditMarkerType.setText("");
|
||||
viewBinding.markerEditDescription.setText("");
|
||||
} else {
|
||||
marker = new ContentProviderUtils(this).getMarker(markerId);
|
||||
if (marker == null) {
|
||||
@@ -143,9 +127,9 @@ public class MarkerEditActivity extends AbstractActivity {
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
markerName.setText(marker.getName());
|
||||
markerType.setText(marker.getCategory());
|
||||
markerDescription.setText(marker.getDescription());
|
||||
viewBinding.markerEditName.setText(marker.getName());
|
||||
viewBinding.markerEditMarkerType.setText(marker.getCategory());
|
||||
viewBinding.markerEditDescription.setText(marker.getDescription());
|
||||
if (marker.hasPhoto()) {
|
||||
photoUri = marker.getPhotoURI();
|
||||
}
|
||||
@@ -183,8 +167,9 @@ public class MarkerEditActivity extends AbstractActivity {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutResId() {
|
||||
return R.layout.marker_edit;
|
||||
protected View getRootView() {
|
||||
viewBinding = MarkerEditBinding.inflate(getLayoutInflater());
|
||||
return viewBinding.getRoot();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -256,7 +241,7 @@ public class MarkerEditActivity extends AbstractActivity {
|
||||
insertPhotoMenuItem.setVisible(!isPhotoSet);
|
||||
insertGalleryImgMenuItem.setVisible(!isPhotoSet);
|
||||
}
|
||||
markerDeletePhotoBtn.setVisibility(isPhotoSet ? View.VISIBLE : View.GONE);
|
||||
viewBinding.markerEditPhotoDelete.setVisibility(isPhotoSet ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -270,7 +255,7 @@ public class MarkerEditActivity extends AbstractActivity {
|
||||
try (ParcelFileDescriptor pfd = getContentResolver().openFileDescriptor(uri, "r")) {
|
||||
FileDescriptor fd = pfd.getFileDescriptor();
|
||||
Bitmap bitmap = BitmapFactory.decodeFileDescriptor(fd);
|
||||
markerPhoto.setImageBitmap(bitmap);
|
||||
viewBinding.markerEditPhoto.setImageBitmap(bitmap);
|
||||
hideAndShowOptions();
|
||||
} catch (IOException e) {
|
||||
Log.e(TAG, e.getMessage());
|
||||
@@ -291,16 +276,16 @@ public class MarkerEditActivity extends AbstractActivity {
|
||||
|
||||
private void addMarker() {
|
||||
trackRecordingServiceConnection.addMarker(this,
|
||||
markerName.getText().toString(),
|
||||
markerType.getText().toString(),
|
||||
markerDescription.getText().toString(),
|
||||
viewBinding.markerEditName.getText().toString(),
|
||||
viewBinding.markerEditMarkerType.getText().toString(),
|
||||
viewBinding.markerEditDescription.getText().toString(),
|
||||
photoUri != null ? photoUri.toString() : null);
|
||||
}
|
||||
|
||||
private void saveMarker() {
|
||||
marker.setName(markerName.getText().toString());
|
||||
marker.setCategory(markerType.getText().toString());
|
||||
marker.setDescription(markerDescription.getText().toString());
|
||||
marker.setName(viewBinding.markerEditName.getText().toString());
|
||||
marker.setCategory(viewBinding.markerEditMarkerType.getText().toString());
|
||||
marker.setDescription(viewBinding.markerEditDescription.getText().toString());
|
||||
marker.setPhotoUrl(photoUri != null ? photoUri.toString() : null);
|
||||
|
||||
new ContentProviderUtils(this).updateMarker(this, marker);
|
||||
|
||||
@@ -26,7 +26,6 @@ import android.view.KeyEvent;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.ListView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.cursoradapter.widget.ResourceCursorAdapter;
|
||||
@@ -38,6 +37,7 @@ import de.dennisguse.opentracks.content.data.Marker;
|
||||
import de.dennisguse.opentracks.content.data.MarkerColumns;
|
||||
import de.dennisguse.opentracks.content.data.Track;
|
||||
import de.dennisguse.opentracks.content.provider.ContentProviderUtils;
|
||||
import de.dennisguse.opentracks.databinding.MarkerListBinding;
|
||||
import de.dennisguse.opentracks.fragments.DeleteMarkerDialogFragment;
|
||||
import de.dennisguse.opentracks.fragments.DeleteMarkerDialogFragment.DeleteMarkerCaller;
|
||||
import de.dennisguse.opentracks.util.ActivityUtils;
|
||||
@@ -81,8 +81,9 @@ public class MarkerListActivity extends AbstractActivity implements DeleteMarker
|
||||
};
|
||||
private Track track;
|
||||
private ResourceCursorAdapter resourceCursorAdapter;
|
||||
// UI elements
|
||||
private ListView listView;
|
||||
|
||||
private MarkerListBinding viewBinding;
|
||||
|
||||
// Callback when an item is selected in the contextual action mode
|
||||
private final ContextualActionModeCallback contextualActionModeCallback = new ContextualActionModeCallback() {
|
||||
@Override
|
||||
@@ -120,9 +121,8 @@ public class MarkerListActivity extends AbstractActivity implements DeleteMarker
|
||||
|
||||
track = trackId != null ? contentProviderUtils.getTrack(trackId) : null;
|
||||
|
||||
listView = findViewById(R.id.marker_list);
|
||||
listView.setEmptyView(findViewById(R.id.marker_list_empty));
|
||||
listView.setOnItemClickListener((parent, view, position, id) -> {
|
||||
viewBinding.markerList.setEmptyView(viewBinding.markerListEmpty);
|
||||
viewBinding.markerList.setOnItemClickListener((parent, view, position, id) -> {
|
||||
Intent intent = IntentUtils.newIntent(MarkerListActivity.this, MarkerDetailActivity.class)
|
||||
.putExtra(MarkerDetailActivity.EXTRA_MARKER_ID, new Marker.Id(id));
|
||||
startActivity(intent);
|
||||
@@ -151,8 +151,8 @@ public class MarkerListActivity extends AbstractActivity implements DeleteMarker
|
||||
ListItemUtils.setListItem(MarkerListActivity.this, view, false, true, iconId, R.string.image_marker, name, null, null, 0, time, false, category, description, photoUrl);
|
||||
}
|
||||
};
|
||||
listView.setAdapter(resourceCursorAdapter);
|
||||
ActivityUtils.configureListViewContextualMenu(listView, contextualActionModeCallback);
|
||||
viewBinding.markerList.setAdapter(resourceCursorAdapter);
|
||||
ActivityUtils.configureListViewContextualMenu(viewBinding.markerList, contextualActionModeCallback);
|
||||
|
||||
LoaderManager.getInstance(this).initLoader(0, null, new LoaderCallbacks<Cursor>() {
|
||||
@NonNull
|
||||
@@ -193,8 +193,9 @@ public class MarkerListActivity extends AbstractActivity implements DeleteMarker
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutResId() {
|
||||
return R.layout.marker_list;
|
||||
protected View getRootView() {
|
||||
viewBinding = MarkerListBinding.inflate(getLayoutInflater());
|
||||
return viewBinding.getRoot();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -254,14 +255,14 @@ public class MarkerListActivity extends AbstractActivity implements DeleteMarker
|
||||
}
|
||||
return true;
|
||||
case R.id.list_context_menu_delete:
|
||||
if (markerIds.length > 1 && markerIds.length == listView.getCount()) {
|
||||
if (markerIds.length > 1 && markerIds.length == viewBinding.markerList.getCount()) {
|
||||
markerIds = null;
|
||||
}
|
||||
DeleteMarkerDialogFragment.showDialog(getSupportFragmentManager(), markerIds);
|
||||
return true;
|
||||
case R.id.list_context_menu_select_all:
|
||||
for (int i = 0; i < listView.getCount(); i++) {
|
||||
listView.setItemChecked(i, true);
|
||||
for (int i = 0; i < viewBinding.markerList.getCount(); i++) {
|
||||
viewBinding.markerList.setItemChecked(i, true);
|
||||
}
|
||||
return false;
|
||||
default:
|
||||
|
||||
@@ -27,7 +27,6 @@ import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.ListView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
@@ -44,6 +43,7 @@ import de.dennisguse.opentracks.content.SearchEngine.SearchQuery;
|
||||
import de.dennisguse.opentracks.content.data.Marker;
|
||||
import de.dennisguse.opentracks.content.data.Track;
|
||||
import de.dennisguse.opentracks.content.provider.ContentProviderUtils;
|
||||
import de.dennisguse.opentracks.databinding.SearchListBinding;
|
||||
import de.dennisguse.opentracks.fragments.ConfirmDeleteDialogFragment;
|
||||
import de.dennisguse.opentracks.fragments.DeleteMarkerDialogFragment;
|
||||
import de.dennisguse.opentracks.fragments.DeleteMarkerDialogFragment.DeleteMarkerCaller;
|
||||
@@ -101,6 +101,8 @@ public class SearchListActivity extends AbstractListActivity implements DeleteMa
|
||||
|
||||
private boolean recordingTrackPaused;
|
||||
|
||||
private SearchListBinding viewBinding;
|
||||
|
||||
// Callback when an item is selected in the contextual action mode
|
||||
private final ContextualActionModeCallback contextualActionModeCallback = new ContextualActionModeCallback() {
|
||||
@Override
|
||||
@@ -198,10 +200,9 @@ public class SearchListActivity extends AbstractListActivity implements DeleteMa
|
||||
}
|
||||
};
|
||||
// UI elements
|
||||
ListView listView = findViewById(R.id.search_list);
|
||||
listView.setAdapter(arrayAdapter);
|
||||
listView.setEmptyView(findViewById(R.id.search_list_empty));
|
||||
listView.setOnItemClickListener((parent, view, position, id) -> {
|
||||
viewBinding.searchList.setEmptyView(viewBinding.searchListEmpty);
|
||||
viewBinding.searchList.setAdapter(arrayAdapter);
|
||||
viewBinding.searchList.setOnItemClickListener((parent, view, position, id) -> {
|
||||
Map<String, Object> item = arrayAdapter.getItem(position);
|
||||
Track.Id trackId = (Track.Id) item.get(TRACK_ID_FIELD);
|
||||
Marker.Id markerId = (Marker.Id) item.get(MARKER_ID_FIELD);
|
||||
@@ -213,7 +214,7 @@ public class SearchListActivity extends AbstractListActivity implements DeleteMa
|
||||
}
|
||||
startActivity(intent);
|
||||
});
|
||||
ActivityUtils.configureListViewContextualMenu(listView, contextualActionModeCallback);
|
||||
ActivityUtils.configureListViewContextualMenu(viewBinding.searchList, contextualActionModeCallback);
|
||||
handleIntent(getIntent());
|
||||
}
|
||||
|
||||
@@ -239,8 +240,9 @@ public class SearchListActivity extends AbstractListActivity implements DeleteMa
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutResId() {
|
||||
return R.layout.search_list;
|
||||
protected View getRootView() {
|
||||
viewBinding = SearchListBinding.inflate(getLayoutInflater());
|
||||
return viewBinding.getRoot();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -26,11 +26,11 @@ import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.View.OnClickListener;
|
||||
import android.widget.ImageButton;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import de.dennisguse.opentracks.databinding.TrackControllerBinding;
|
||||
import de.dennisguse.opentracks.services.TrackRecordingServiceConnection;
|
||||
import de.dennisguse.opentracks.services.TrackRecordingServiceInterface;
|
||||
import de.dennisguse.opentracks.util.ActivityUtils;
|
||||
@@ -49,14 +49,11 @@ public class TrackController {
|
||||
private final Activity activity;
|
||||
private final TrackRecordingServiceConnection trackRecordingServiceConnection;
|
||||
private final Handler handlerUpdateTotalTime;
|
||||
private final View containerView;
|
||||
private final TextView statusTextView;
|
||||
private final TextView totalTimeTextView;
|
||||
private final ImageButton recordImageButton;
|
||||
private final ImageButton stopImageButton;
|
||||
private final boolean alwaysShow;
|
||||
private ButtonDelay buttonDelay;
|
||||
|
||||
private final TrackControllerBinding viewBinding;
|
||||
|
||||
private boolean isRecording;
|
||||
private boolean isPaused;
|
||||
private long totalTime = 0;
|
||||
@@ -69,37 +66,32 @@ public class TrackController {
|
||||
private final Runnable updateTotalTimeRunnable = new Runnable() {
|
||||
public void run() {
|
||||
if (isResumed && isRecording && !isPaused) {
|
||||
totalTimeTextView.setText(StringUtils.formatElapsedTimeWithHour(System.currentTimeMillis() - totalTimeTimestamp + totalTime));
|
||||
viewBinding.trackControllerTotalTime.setText(StringUtils.formatElapsedTimeWithHour(System.currentTimeMillis() - totalTimeTimestamp + totalTime));
|
||||
handlerUpdateTotalTime.postDelayed(this, UnitConversions.ONE_SECOND_MS);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@SuppressLint("ClickableViewAccessibility")
|
||||
TrackController(Activity activity, TrackRecordingServiceConnection trackRecordingServiceConnection, boolean alwaysShow, OnClickListener recordListener, OnClickListener stopListener) {
|
||||
TrackController(Activity activity, TrackControllerBinding viewBinding, TrackRecordingServiceConnection trackRecordingServiceConnection, boolean alwaysShow, OnClickListener recordListener, OnClickListener stopListener) {
|
||||
this.activity = activity;
|
||||
this.viewBinding = viewBinding;
|
||||
this.trackRecordingServiceConnection = trackRecordingServiceConnection;
|
||||
this.alwaysShow = alwaysShow;
|
||||
handlerUpdateTotalTime = new Handler();
|
||||
containerView = activity.findViewById(R.id.track_controller_container);
|
||||
statusTextView = activity.findViewById(R.id.track_controller_status);
|
||||
totalTimeTextView = activity.findViewById(R.id.track_controller_total_time);
|
||||
viewBinding.trackControllerRecord.setOnTouchListener((view, motionEvent) -> onRecordTouch(activity, recordListener, motionEvent));
|
||||
|
||||
recordImageButton = activity.findViewById(R.id.track_controller_record);
|
||||
recordImageButton.setOnTouchListener((view, motionEvent) -> onRecordTouch(activity, recordListener, motionEvent));
|
||||
|
||||
stopImageButton = activity.findViewById(R.id.track_controller_stop);
|
||||
stopImageButton.setOnTouchListener((view, motionEvent) -> onStopTouch(activity, stopListener, motionEvent));
|
||||
viewBinding.trackControllerStop.setOnTouchListener((view, motionEvent) -> onStopTouch(activity, stopListener, motionEvent));
|
||||
}
|
||||
|
||||
private boolean onRecordTouch(final Activity activity, final OnClickListener recordListener, final MotionEvent motionEvent) {
|
||||
if (isRecording && !isPaused) {
|
||||
if (motionEvent.getAction() == MotionEvent.ACTION_DOWN) {
|
||||
buttonDelay = new ButtonDelay(activity, recordImageButton, R.drawable.ic_button_pause_anim, R.string.hold_to_pause, recordListener);
|
||||
buttonDelay = new ButtonDelay(activity, viewBinding.trackControllerRecord, R.drawable.ic_button_pause_anim, R.string.hold_to_pause, recordListener);
|
||||
new Thread(buttonDelay).start();
|
||||
return true;
|
||||
} else if (motionEvent.getAction() == MotionEvent.ACTION_UP ) {
|
||||
recordImageButton.setImageResource(R.drawable.ic_button_pause);
|
||||
} else if (motionEvent.getAction() == MotionEvent.ACTION_UP) {
|
||||
viewBinding.trackControllerRecord.setImageResource(R.drawable.ic_button_pause);
|
||||
if (buttonDelay != null) {
|
||||
buttonDelay.canceled = true;
|
||||
}
|
||||
@@ -115,11 +107,11 @@ public class TrackController {
|
||||
private boolean onStopTouch(final Activity activity, final OnClickListener stopListener, final MotionEvent motionEvent) {
|
||||
if (isRecording) {
|
||||
if (motionEvent.getAction() == MotionEvent.ACTION_DOWN) {
|
||||
buttonDelay = new ButtonDelay(activity, stopImageButton, R.drawable.ic_button_stop_anim, R.string.hold_to_stop, stopListener);
|
||||
buttonDelay = new ButtonDelay(activity, viewBinding.trackControllerStop, R.drawable.ic_button_stop_anim, R.string.hold_to_stop, stopListener);
|
||||
new Thread(buttonDelay).start();
|
||||
return true;
|
||||
} else if (motionEvent.getAction() == MotionEvent.ACTION_UP ) {
|
||||
stopImageButton.setImageResource(R.drawable.ic_button_stop);
|
||||
} else if (motionEvent.getAction() == MotionEvent.ACTION_UP) {
|
||||
viewBinding.trackControllerStop.setImageResource(R.drawable.ic_button_stop);
|
||||
if (buttonDelay != null) {
|
||||
buttonDelay.canceled = true;
|
||||
}
|
||||
@@ -151,7 +143,7 @@ public class TrackController {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
activity.runOnUiThread(()->{
|
||||
activity.runOnUiThread(() -> {
|
||||
imageButton.setImageDrawable(drawable);
|
||||
if (drawable instanceof AnimatedVectorDrawable) {
|
||||
((AnimatedVectorDrawable) drawable).start();
|
||||
@@ -165,7 +157,7 @@ public class TrackController {
|
||||
} catch (InterruptedException ignored) {
|
||||
}
|
||||
if (!canceled) {
|
||||
activity.runOnUiThread(()-> {
|
||||
activity.runOnUiThread(() -> {
|
||||
clickListener.onClick(null);
|
||||
ActivityUtils.vibrate(activity, 1000);
|
||||
});
|
||||
@@ -180,30 +172,30 @@ public class TrackController {
|
||||
isRecording = recording;
|
||||
isPaused = paused;
|
||||
boolean visible = alwaysShow || isRecording;
|
||||
containerView.setVisibility(visible ? View.VISIBLE : View.GONE);
|
||||
viewBinding.trackControllerContainer.setVisibility(visible ? View.VISIBLE : View.GONE);
|
||||
|
||||
if (!visible) {
|
||||
handlerUpdateTotalTime.removeCallbacks(updateTotalTimeRunnable);
|
||||
return;
|
||||
}
|
||||
|
||||
recordImageButton.setImageResource(isRecording && !isPaused ? R.drawable.ic_button_pause : R.drawable.button_record);
|
||||
recordImageButton.setContentDescription(activity.getString(isRecording && !isPaused ? R.string.image_pause : R.string.image_record));
|
||||
viewBinding.trackControllerRecord.setImageResource(isRecording && !isPaused ? R.drawable.ic_button_pause : R.drawable.button_record);
|
||||
viewBinding.trackControllerRecord.setContentDescription(activity.getString(isRecording && !isPaused ? R.string.image_pause : R.string.image_record));
|
||||
|
||||
stopImageButton.setImageResource(isRecording ? R.drawable.ic_button_stop : R.drawable.ic_button_stop_disabled);
|
||||
stopImageButton.setEnabled(isRecording);
|
||||
viewBinding.trackControllerStop.setImageResource(isRecording ? R.drawable.ic_button_stop : R.drawable.ic_button_stop_disabled);
|
||||
viewBinding.trackControllerStop.setEnabled(isRecording);
|
||||
|
||||
statusTextView.setVisibility(isRecording ? View.VISIBLE : View.INVISIBLE);
|
||||
viewBinding.trackControllerStatus.setVisibility(isRecording ? View.VISIBLE : View.INVISIBLE);
|
||||
if (isRecording) {
|
||||
statusTextView.setTextColor(activity.getResources().getColor(isPaused ? android.R.color.white : R.color.recording_text));
|
||||
statusTextView.setText(isPaused ? R.string.generic_paused : R.string.generic_recording);
|
||||
viewBinding.trackControllerStatus.setTextColor(activity.getResources().getColor(isPaused ? android.R.color.white : R.color.recording_text));
|
||||
viewBinding.trackControllerStatus.setText(isPaused ? R.string.generic_paused : R.string.generic_recording);
|
||||
}
|
||||
|
||||
handlerUpdateTotalTime.removeCallbacks(updateTotalTimeRunnable);
|
||||
totalTimeTextView.setVisibility(isRecording ? View.VISIBLE : View.INVISIBLE);
|
||||
viewBinding.trackControllerTotalTime.setVisibility(isRecording ? View.VISIBLE : View.INVISIBLE);
|
||||
if (isRecording) {
|
||||
totalTime = getTotalTime();
|
||||
totalTimeTextView.setText(StringUtils.formatElapsedTimeWithHour(totalTime));
|
||||
viewBinding.trackControllerTotalTime.setText(StringUtils.formatElapsedTimeWithHour(totalTime));
|
||||
if (!isPaused) {
|
||||
totalTimeTimestamp = System.currentTimeMillis();
|
||||
handlerUpdateTotalTime.postDelayed(updateTotalTimeRunnable, UnitConversions.ONE_SECOND_MS);
|
||||
@@ -222,11 +214,11 @@ public class TrackController {
|
||||
}
|
||||
|
||||
public void hide() {
|
||||
containerView.setVisibility(View.GONE);
|
||||
viewBinding.trackControllerContainer.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
public void show() {
|
||||
containerView.setVisibility(View.VISIBLE);
|
||||
viewBinding.trackControllerContainer.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -25,6 +25,7 @@ import java.util.List;
|
||||
|
||||
import de.dennisguse.opentracks.content.data.Track;
|
||||
import de.dennisguse.opentracks.content.provider.ContentProviderUtils;
|
||||
import de.dennisguse.opentracks.databinding.TrackDeleteBinding;
|
||||
import de.dennisguse.opentracks.util.SystemUtils;
|
||||
|
||||
/**
|
||||
@@ -40,6 +41,8 @@ public class TrackDeleteActivity extends AbstractActivity {
|
||||
|
||||
private Thread deleteThread;
|
||||
|
||||
private TrackDeleteBinding viewBinding;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
@@ -82,12 +85,13 @@ public class TrackDeleteActivity extends AbstractActivity {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutResId() {
|
||||
return R.layout.track_delete;
|
||||
protected View getRootView() {
|
||||
viewBinding = TrackDeleteBinding.inflate(getLayoutInflater());
|
||||
return viewBinding.getRoot();
|
||||
}
|
||||
|
||||
public void onAsyncTaskCompleted() {
|
||||
findViewById(R.id.progressbar).setVisibility(View.INVISIBLE);
|
||||
viewBinding.progressbar.setVisibility(View.INVISIBLE);
|
||||
setResult(RESULT_OK);
|
||||
finish();
|
||||
}
|
||||
|
||||
@@ -22,16 +22,12 @@ import android.view.KeyEvent;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.AutoCompleteTextView;
|
||||
import android.widget.Button;
|
||||
import android.widget.Spinner;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.google.android.material.textfield.TextInputEditText;
|
||||
|
||||
import de.dennisguse.opentracks.content.data.Track;
|
||||
import de.dennisguse.opentracks.content.provider.ContentProviderUtils;
|
||||
import de.dennisguse.opentracks.databinding.TrackEditBinding;
|
||||
import de.dennisguse.opentracks.fragments.ChooseActivityTypeDialogFragment;
|
||||
import de.dennisguse.opentracks.services.TrackRecordingServiceConnection;
|
||||
import de.dennisguse.opentracks.util.TrackIconUtils;
|
||||
@@ -56,10 +52,7 @@ public class TrackEditActivity extends AbstractActivity implements ChooseActivit
|
||||
private Track track;
|
||||
private String iconValue;
|
||||
|
||||
private TextInputEditText nameEditText;
|
||||
private AutoCompleteTextView activityType;
|
||||
private Spinner activityTypeIcon;
|
||||
private TextInputEditText description;
|
||||
private TrackEditBinding viewBinding;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle bundle) {
|
||||
@@ -81,20 +74,17 @@ public class TrackEditActivity extends AbstractActivity implements ChooseActivit
|
||||
return;
|
||||
}
|
||||
|
||||
nameEditText = findViewById(R.id.track_edit_name);
|
||||
nameEditText.setText(track.getName());
|
||||
viewBinding.trackEditName.setText(track.getName());
|
||||
|
||||
activityType = findViewById(R.id.track_edit_activity_type);
|
||||
activityType.setText(track.getCategory());
|
||||
viewBinding.trackEditActivityType.setText(track.getCategory());
|
||||
|
||||
ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this, R.array.activity_types, android.R.layout.simple_dropdown_item_1line);
|
||||
activityType.setAdapter(adapter);
|
||||
activityType.setOnItemClickListener((parent, view, position, id) -> setActivityTypeIcon(TrackIconUtils.getIconValue(
|
||||
TrackEditActivity.this, (String) activityType.getAdapter().getItem(position))));
|
||||
activityType.setOnFocusChangeListener((v, hasFocus) -> {
|
||||
viewBinding.trackEditActivityType.setAdapter(adapter);
|
||||
viewBinding.trackEditActivityType.setOnItemClickListener((parent, view, position, id) -> setActivityTypeIcon(TrackIconUtils.getIconValue(this, (String) viewBinding.trackEditActivityType.getAdapter().getItem(position))));
|
||||
viewBinding.trackEditActivityType.setOnFocusChangeListener((v, hasFocus) -> {
|
||||
if (!hasFocus) {
|
||||
setActivityTypeIcon(TrackIconUtils.getIconValue(
|
||||
TrackEditActivity.this, activityType.getText().toString()));
|
||||
TrackEditActivity.this, viewBinding.trackEditActivityType.getText().toString()));
|
||||
}
|
||||
});
|
||||
|
||||
@@ -106,40 +96,36 @@ public class TrackEditActivity extends AbstractActivity implements ChooseActivit
|
||||
iconValue = track.getIcon();
|
||||
}
|
||||
|
||||
activityTypeIcon = findViewById(R.id.track_edit_activity_type_icon);
|
||||
activityTypeIcon.setAdapter(TrackIconUtils.getIconSpinnerAdapter(this, iconValue));
|
||||
activityTypeIcon.setOnTouchListener((v, event) -> {
|
||||
viewBinding.trackEditActivityTypeIcon.setAdapter(TrackIconUtils.getIconSpinnerAdapter(this, iconValue));
|
||||
viewBinding.trackEditActivityTypeIcon.setOnTouchListener((v, event) -> {
|
||||
if (event.getAction() == MotionEvent.ACTION_UP) {
|
||||
ChooseActivityTypeDialogFragment.showDialog(getSupportFragmentManager(), activityType.getText().toString());
|
||||
ChooseActivityTypeDialogFragment.showDialog(getSupportFragmentManager(), viewBinding.trackEditActivityType.getText().toString());
|
||||
}
|
||||
return true;
|
||||
});
|
||||
activityTypeIcon.setOnKeyListener((v, keyCode, event) -> {
|
||||
viewBinding.trackEditActivityTypeIcon.setOnKeyListener((v, keyCode, event) -> {
|
||||
if (keyCode == KeyEvent.KEYCODE_DPAD_CENTER) {
|
||||
ChooseActivityTypeDialogFragment.showDialog(getSupportFragmentManager(), activityType.getText().toString());
|
||||
ChooseActivityTypeDialogFragment.showDialog(getSupportFragmentManager(), viewBinding.trackEditActivityType.getText().toString());
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
||||
description = findViewById(R.id.track_edit_description);
|
||||
description.setText(track.getDescription());
|
||||
viewBinding.trackEditDescription.setText(track.getDescription());
|
||||
|
||||
Button saveButton = findViewById(R.id.track_edit_save);
|
||||
saveButton.setOnClickListener(v -> {
|
||||
TrackUtils.updateTrack(TrackEditActivity.this, track, nameEditText.getText().toString(),
|
||||
activityType.getText().toString(), description.getText().toString(),
|
||||
viewBinding.trackEditSave.setOnClickListener(v -> {
|
||||
TrackUtils.updateTrack(TrackEditActivity.this, track, viewBinding.trackEditName.getText().toString(),
|
||||
viewBinding.trackEditActivityType.getText().toString(), viewBinding.trackEditDescription.getText().toString(),
|
||||
contentProviderUtils);
|
||||
finish();
|
||||
});
|
||||
|
||||
Button cancel = findViewById(R.id.track_edit_cancel);
|
||||
if (getIntent().getBooleanExtra(EXTRA_NEW_TRACK, false)) {
|
||||
setTitle(R.string.track_edit_new_track_title);
|
||||
cancel.setVisibility(View.GONE);
|
||||
viewBinding.trackEditCancel.setVisibility(View.GONE);
|
||||
} else {
|
||||
setTitle(R.string.menu_edit);
|
||||
cancel.setOnClickListener(v -> finish());
|
||||
cancel.setVisibility(View.VISIBLE);
|
||||
viewBinding.trackEditCancel.setOnClickListener(v -> finish());
|
||||
viewBinding.trackEditCancel.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -163,18 +149,19 @@ public class TrackEditActivity extends AbstractActivity implements ChooseActivit
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutResId() {
|
||||
return R.layout.track_edit;
|
||||
protected View getRootView() {
|
||||
viewBinding = TrackEditBinding.inflate(getLayoutInflater());
|
||||
return viewBinding.getRoot();
|
||||
}
|
||||
|
||||
private void setActivityTypeIcon(String value) {
|
||||
iconValue = value;
|
||||
TrackIconUtils.setIconSpinner(activityTypeIcon, value);
|
||||
private void setActivityTypeIcon(String iconValue) {
|
||||
this.iconValue = iconValue;
|
||||
TrackIconUtils.setIconSpinner(viewBinding.trackEditActivityTypeIcon, iconValue);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChooseActivityTypeDone(String value) {
|
||||
setActivityTypeIcon(value);
|
||||
activityType.setText(getString(TrackIconUtils.getIconActivityType(value)));
|
||||
viewBinding.trackEditActivityType.setText(getString(TrackIconUtils.getIconActivityType(value)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,6 @@ import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.View.OnClickListener;
|
||||
import android.widget.ListView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
@@ -48,6 +47,7 @@ import androidx.loader.content.Loader;
|
||||
import de.dennisguse.opentracks.content.data.Track;
|
||||
import de.dennisguse.opentracks.content.data.TracksColumns;
|
||||
import de.dennisguse.opentracks.content.provider.ContentProviderUtils;
|
||||
import de.dennisguse.opentracks.databinding.TrackListBinding;
|
||||
import de.dennisguse.opentracks.fragments.ConfirmDeleteDialogFragment;
|
||||
import de.dennisguse.opentracks.services.TrackRecordingServiceConnection;
|
||||
import de.dennisguse.opentracks.services.TrackRecordingServiceInterface;
|
||||
@@ -75,10 +75,11 @@ public class TrackListActivity extends AbstractListActivity implements ConfirmDe
|
||||
private SharedPreferences sharedPreferences;
|
||||
private TrackRecordingServiceConnection trackRecordingServiceConnection;
|
||||
private TrackController trackController;
|
||||
private ListView listView;
|
||||
private ResourceCursorAdapter resourceCursorAdapter;
|
||||
private GpsStatusValue gpsStatusValue;
|
||||
|
||||
private TrackListBinding viewBinding;
|
||||
|
||||
private final LoaderCallbacks<Cursor> loaderCallbacks = new LoaderCallbacks<Cursor>() {
|
||||
@Override
|
||||
public Loader<Cursor> onCreateLoader(int arg0, Bundle arg1) {
|
||||
@@ -227,7 +228,7 @@ public class TrackListActivity extends AbstractListActivity implements ConfirmDe
|
||||
sharedPreferences = PreferencesUtils.getSharedPreferences(this);
|
||||
|
||||
trackRecordingServiceConnection = new TrackRecordingServiceConnection(bindChangedCallback);
|
||||
trackController = new TrackController(this, trackRecordingServiceConnection, true, recordListener, stopListener);
|
||||
trackController = new TrackController(this, viewBinding.trackControllerContainer, trackRecordingServiceConnection, true, recordListener, stopListener);
|
||||
|
||||
setDefaultKeyMode(DEFAULT_KEYS_SEARCH_LOCAL);
|
||||
|
||||
@@ -237,9 +238,8 @@ public class TrackListActivity extends AbstractListActivity implements ConfirmDe
|
||||
searchManager.setOnDismissListener(() -> trackController.show());
|
||||
}
|
||||
|
||||
listView = findViewById(R.id.track_list);
|
||||
listView.setEmptyView(findViewById(R.id.track_list_empty_view));
|
||||
listView.setOnItemClickListener((parent, view, position, trackId) -> {
|
||||
viewBinding.trackList.setEmptyView(viewBinding.trackListEmptyView);
|
||||
viewBinding.trackList.setOnItemClickListener((parent, view, position, trackId) -> {
|
||||
Intent newIntent;
|
||||
if (trackId == recordingTrackId.getId()) {
|
||||
// Is recording -> open record activity.
|
||||
@@ -282,9 +282,9 @@ public class TrackListActivity extends AbstractListActivity implements ConfirmDe
|
||||
startTime, true, category, description, null);
|
||||
}
|
||||
};
|
||||
listView.setAdapter(resourceCursorAdapter);
|
||||
viewBinding.trackList.setAdapter(resourceCursorAdapter);
|
||||
|
||||
ActivityUtils.configureListViewContextualMenu(listView, contextualActionModeCallback);
|
||||
ActivityUtils.configureListViewContextualMenu(viewBinding.trackList, contextualActionModeCallback);
|
||||
|
||||
LoaderManager.getInstance(this).initLoader(0, null, loaderCallbacks);
|
||||
|
||||
@@ -338,8 +338,9 @@ public class TrackListActivity extends AbstractListActivity implements ConfirmDe
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutResId() {
|
||||
return R.layout.track_list;
|
||||
protected View getRootView() {
|
||||
viewBinding = TrackListBinding.inflate(getLayoutInflater());
|
||||
return viewBinding.getRoot();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -503,9 +504,9 @@ public class TrackListActivity extends AbstractListActivity implements ConfirmDe
|
||||
deleteTracks(trackIds);
|
||||
return true;
|
||||
case R.id.list_context_menu_select_all:
|
||||
int size = listView.getCount();
|
||||
int size = viewBinding.trackList.getCount();
|
||||
for (int i = 0; i < size; i++) {
|
||||
listView.setItemChecked(i, true);
|
||||
viewBinding.trackList.setItemChecked(i, true);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -21,19 +21,18 @@ import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentPagerAdapter;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
|
||||
import com.google.android.material.tabs.TabLayout;
|
||||
|
||||
import de.dennisguse.opentracks.content.TrackDataHub;
|
||||
import de.dennisguse.opentracks.content.data.Marker;
|
||||
import de.dennisguse.opentracks.content.data.Track;
|
||||
import de.dennisguse.opentracks.content.provider.ContentProviderUtils;
|
||||
import de.dennisguse.opentracks.databinding.TrackRecordedBinding;
|
||||
import de.dennisguse.opentracks.fragments.ChartFragment;
|
||||
import de.dennisguse.opentracks.fragments.ConfirmDeleteDialogFragment;
|
||||
import de.dennisguse.opentracks.fragments.IntervalsFragment;
|
||||
@@ -62,7 +61,8 @@ public class TrackRecordedActivity extends AbstractListActivity implements Confi
|
||||
// The following are set in onCreate.
|
||||
private ContentProviderUtils contentProviderUtils;
|
||||
private TrackDataHub trackDataHub;
|
||||
private ViewPager pager;
|
||||
|
||||
private TrackRecordedBinding viewBinding;
|
||||
|
||||
private Track.Id trackId;
|
||||
|
||||
@@ -75,12 +75,10 @@ public class TrackRecordedActivity extends AbstractListActivity implements Confi
|
||||
|
||||
trackDataHub = new TrackDataHub(this);
|
||||
|
||||
pager = findViewById(R.id.track_detail_activity_view_pager);
|
||||
pager.setAdapter(new CustomFragmentPagerAdapter(getSupportFragmentManager(), FragmentPagerAdapter.BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT));
|
||||
TabLayout tabs = findViewById(R.id.track_detail_activity_tablayout);
|
||||
tabs.setupWithViewPager(pager);
|
||||
viewBinding.trackDetailActivityViewPager.setAdapter(new CustomFragmentPagerAdapter(getSupportFragmentManager(), FragmentPagerAdapter.BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT));
|
||||
viewBinding.trackDetailActivityTablayout.setupWithViewPager(viewBinding.trackDetailActivityViewPager);
|
||||
if (savedInstanceState != null) {
|
||||
pager.setCurrentItem(savedInstanceState.getInt(CURRENT_TAB_TAG_KEY));
|
||||
viewBinding.trackDetailActivityViewPager.setCurrentItem(savedInstanceState.getInt(CURRENT_TAB_TAG_KEY));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -111,12 +109,13 @@ public class TrackRecordedActivity extends AbstractListActivity implements Confi
|
||||
@Override
|
||||
protected void onSaveInstanceState(@NonNull Bundle outState) {
|
||||
super.onSaveInstanceState(outState);
|
||||
outState.putInt(CURRENT_TAB_TAG_KEY, pager.getCurrentItem());
|
||||
outState.putInt(CURRENT_TAB_TAG_KEY, viewBinding.trackDetailActivityViewPager.getCurrentItem());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutResId() {
|
||||
return R.layout.track_detail;
|
||||
protected View getRootView() {
|
||||
viewBinding = TrackRecordedBinding.inflate(getLayoutInflater());
|
||||
return viewBinding.getRoot();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -16,13 +16,11 @@ import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentPagerAdapter;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
|
||||
import com.google.android.material.tabs.TabLayout;
|
||||
|
||||
import de.dennisguse.opentracks.content.TrackDataHub;
|
||||
import de.dennisguse.opentracks.content.data.Track;
|
||||
import de.dennisguse.opentracks.content.provider.ContentProviderUtils;
|
||||
import de.dennisguse.opentracks.databinding.TrackRecordingBinding;
|
||||
import de.dennisguse.opentracks.fragments.ChartFragment;
|
||||
import de.dennisguse.opentracks.fragments.ChooseActivityTypeDialogFragment;
|
||||
import de.dennisguse.opentracks.fragments.IntervalsFragment;
|
||||
@@ -57,9 +55,10 @@ public class TrackRecordingActivity extends AbstractActivity implements ChooseAc
|
||||
private SharedPreferences sharedPreferences;
|
||||
private TrackRecordingServiceConnection trackRecordingServiceConnection;
|
||||
private TrackDataHub trackDataHub;
|
||||
private ViewPager pager;
|
||||
private TrackController trackController;
|
||||
|
||||
private TrackRecordingBinding viewBinding;
|
||||
|
||||
// Initialized from Intent; if a new track recording is started, a new TrackId will be provided by TrackRecordingService
|
||||
private Track.Id trackId;
|
||||
|
||||
@@ -180,15 +179,13 @@ public class TrackRecordingActivity extends AbstractActivity implements ChooseAc
|
||||
trackRecordingServiceConnection = new TrackRecordingServiceConnection(bindChangedCallback);
|
||||
trackDataHub = new TrackDataHub(this);
|
||||
|
||||
pager = findViewById(R.id.track_detail_activity_view_pager);
|
||||
pager.setAdapter(new CustomFragmentPagerAdapter(getSupportFragmentManager(), FragmentPagerAdapter.BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT));
|
||||
TabLayout tabs = findViewById(R.id.track_detail_activity_tablayout);
|
||||
tabs.setupWithViewPager(pager);
|
||||
viewBinding.trackDetailActivityViewPager.setAdapter(new CustomFragmentPagerAdapter(getSupportFragmentManager(), FragmentPagerAdapter.BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT));
|
||||
viewBinding.trackDetailActivityTablayout.setupWithViewPager(viewBinding.trackDetailActivityViewPager);
|
||||
if (savedInstanceState != null) {
|
||||
pager.setCurrentItem(savedInstanceState.getInt(CURRENT_TAB_TAG_KEY));
|
||||
viewBinding.trackDetailActivityViewPager.setCurrentItem(savedInstanceState.getInt(CURRENT_TAB_TAG_KEY));
|
||||
}
|
||||
|
||||
trackController = new TrackController(this, trackRecordingServiceConnection, false, recordListener, stopListener);
|
||||
trackController = new TrackController(this, viewBinding.trackControllerContainer, trackRecordingServiceConnection, false, recordListener, stopListener);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -266,7 +263,7 @@ public class TrackRecordingActivity extends AbstractActivity implements ChooseAc
|
||||
@Override
|
||||
protected void onSaveInstanceState(@NonNull Bundle outState) {
|
||||
super.onSaveInstanceState(outState);
|
||||
outState.putInt(CURRENT_TAB_TAG_KEY, pager.getCurrentItem());
|
||||
outState.putInt(CURRENT_TAB_TAG_KEY, viewBinding.trackDetailActivityViewPager.getCurrentItem());
|
||||
outState.putParcelable(EXTRA_TRACK_ID, trackId);
|
||||
}
|
||||
|
||||
@@ -285,8 +282,9 @@ public class TrackRecordingActivity extends AbstractActivity implements ChooseAc
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutResId() {
|
||||
return R.layout.track_record;
|
||||
protected View getRootView() {
|
||||
viewBinding = TrackRecordingBinding.inflate(getLayoutInflater());
|
||||
return viewBinding.getRoot();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -20,10 +20,10 @@ import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import de.dennisguse.opentracks.content.data.Track;
|
||||
import de.dennisguse.opentracks.content.data.TracksColumns;
|
||||
@@ -213,10 +213,9 @@ public class ShareContentProvider extends CustomContentProvider {
|
||||
Set<Track.Id> trackIds = parseURI(uri);
|
||||
final ArrayList<Track> tracks = new ArrayList<>();
|
||||
String[] trackIdsString = trackIds.stream().map(Track.Id::toString).toArray(String[]::new);
|
||||
String trackIdsPlaceholder = TextUtils.join(",", Stream.of(trackIdsString).map(it -> "?").toArray(String[]::new));
|
||||
String whereClause = String.format(TracksColumns._ID + " IN (%s)", TextUtils.join(",", Collections.nCopies(trackIds.size(), "?")));
|
||||
|
||||
TextUtils.join(",", trackIds);
|
||||
try (Cursor cursor = super.query(TracksColumns.CONTENT_URI, null, TracksColumns._ID + " IN (" + trackIdsPlaceholder + ")", trackIdsString, TracksColumns._ID)) {
|
||||
try (Cursor cursor = super.query(TracksColumns.CONTENT_URI, null, whereClause, trackIdsString, TracksColumns._ID)) {
|
||||
while (cursor.moveToNext()) {
|
||||
tracks.add(ContentProviderUtils.createTrack(cursor));
|
||||
}
|
||||
|
||||
@@ -183,8 +183,8 @@ public class ChartFragment extends Fragment implements TrackDataListener {
|
||||
@Override
|
||||
public void onStop() {
|
||||
super.onStop();
|
||||
ViewGroup layout = getView().findViewById(R.id.chart_view_layout);
|
||||
layout.removeView(chartView);
|
||||
|
||||
viewBinding.chartViewLayout.removeView(chartView);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -8,7 +8,6 @@ import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.Spinner;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
@@ -43,7 +42,6 @@ public class IntervalsFragment extends Fragment implements TrackDataListener {
|
||||
|
||||
private String intervalUnit;
|
||||
private IntervalStatisticsAdapter adapter;
|
||||
protected Spinner spinnerIntervals;
|
||||
private ArrayAdapter<IntervalStatisticsModel.IntervalOption> spinnerAdapter;
|
||||
|
||||
private TrackDataHub trackDataHub;
|
||||
@@ -78,14 +76,12 @@ public class IntervalsFragment extends Fragment implements TrackDataListener {
|
||||
PreferencesUtils.register(getContext(), sharedPreferenceChangeListener);
|
||||
intervalUnit = PreferencesUtils.isMetricUnits(getContext()) ? getContext().getString(R.string.unit_kilometer) : getContext().getString(R.string.unit_mile);
|
||||
|
||||
viewBinding.intervalList.setEmptyView(view.findViewById(R.id.interval_list_empty_view));
|
||||
viewBinding.intervalList.setEmptyView(viewBinding.intervalListEmptyView);
|
||||
|
||||
stackModeListView = IntervalStatisticsAdapter.StackMode.STACK_FROM_TOP;
|
||||
|
||||
viewModel = new IntervalStatisticsModel();
|
||||
|
||||
spinnerIntervals = view.findViewById(R.id.spinner_intervals);
|
||||
|
||||
spinnerAdapter = new ArrayAdapter<IntervalStatisticsModel.IntervalOption>(getContext(), android.R.layout.simple_spinner_dropdown_item, IntervalStatisticsModel.IntervalOption.values()) {
|
||||
@NonNull
|
||||
@Override
|
||||
@@ -102,9 +98,9 @@ public class IntervalsFragment extends Fragment implements TrackDataListener {
|
||||
return v;
|
||||
}
|
||||
};
|
||||
spinnerIntervals.setAdapter(spinnerAdapter);
|
||||
|
||||
spinnerIntervals.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
viewBinding.spinnerIntervals.setAdapter(spinnerAdapter);
|
||||
viewBinding.spinnerIntervals.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
@Override
|
||||
public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {
|
||||
selectedInterval = IntervalStatisticsModel.IntervalOption.values()[i];
|
||||
@@ -113,7 +109,6 @@ public class IntervalsFragment extends Fragment implements TrackDataListener {
|
||||
|
||||
@Override
|
||||
public void onNothingSelected(AdapterView<?> adapterView) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -143,7 +138,6 @@ public class IntervalsFragment extends Fragment implements TrackDataListener {
|
||||
PreferencesUtils.unregister(getContext(), sharedPreferenceChangeListener);
|
||||
|
||||
adapter = null;
|
||||
spinnerIntervals = null;
|
||||
viewModel = null;
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,6 @@ import android.view.ViewGroup;
|
||||
import android.view.animation.Animation;
|
||||
import android.view.animation.Animation.AnimationListener;
|
||||
import android.view.animation.AnimationUtils;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
@@ -230,24 +229,17 @@ public class MarkerDetailFragment extends Fragment {
|
||||
viewBinding.markerDetailMarkerPhoto.setImageResource(MarkerUtils.ICON_ID);
|
||||
}
|
||||
|
||||
setName(hasPhoto);
|
||||
ListItemUtils.setTextView(getActivity(), viewBinding.markerDetailMarkerName, marker.getName(), hasPhoto);
|
||||
|
||||
TextView category = getView().findViewById(R.id.marker_detail_marker_category);
|
||||
ListItemUtils.setTextView(getActivity(), category, StringUtils.getCategory(marker.getCategory()), hasPhoto);
|
||||
|
||||
TextView description = getView().findViewById(R.id.marker_detail_marker_description);
|
||||
ListItemUtils.setTextView(getActivity(), description, marker.getDescription(), hasPhoto);
|
||||
ListItemUtils.setTextView(getActivity(), viewBinding.markerDetailMarkerCategory, StringUtils.getCategory(marker.getCategory()), hasPhoto);
|
||||
|
||||
ListItemUtils.setTextView(getActivity(), viewBinding.markerDetailMarkerDescription, marker.getDescription(), hasPhoto);
|
||||
|
||||
setLocation(hasPhoto);
|
||||
}
|
||||
|
||||
private void setName(boolean addShadow) {
|
||||
TextView textView = getView().findViewById(R.id.marker_detail_marker_name);
|
||||
ListItemUtils.setTextView(getActivity(), textView, marker.getName(), addShadow);
|
||||
}
|
||||
|
||||
private void setLocation(boolean addShadow) {
|
||||
TextView textView = getView().findViewById(R.id.marker_detail_marker_location);
|
||||
Location location = marker.getLocation();
|
||||
String value;
|
||||
if (location == null) {
|
||||
@@ -258,6 +250,6 @@ public class MarkerDetailFragment extends Fragment {
|
||||
+ getString(R.string.stats_longitude) + " "
|
||||
+ StringUtils.formatCoordinate(location.getLongitude()) + "]";
|
||||
}
|
||||
ListItemUtils.setTextView(getActivity(), textView, value, addShadow);
|
||||
ListItemUtils.setTextView(getActivity(), viewBinding.markerDetailMarkerLocation, value, addShadow);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@ import android.view.LayoutInflater;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Spinner;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
@@ -105,15 +104,14 @@ public class StatisticsRecordingFragment extends Fragment implements TrackDataLi
|
||||
|
||||
handlerUpdateUI = new Handler();
|
||||
|
||||
Spinner activityTypeIcon = getView().findViewById(R.id.stats_activity_type_icon);
|
||||
activityTypeIcon.setAdapter(TrackIconUtils.getIconSpinnerAdapter(getActivity(), ""));
|
||||
activityTypeIcon.setOnTouchListener((v, event) -> {
|
||||
viewBinding.statsActivityTypeIcon.setAdapter(TrackIconUtils.getIconSpinnerAdapter(getActivity(), ""));
|
||||
viewBinding.statsActivityTypeIcon.setOnTouchListener((v, event) -> {
|
||||
if (event.getAction() == MotionEvent.ACTION_UP) {
|
||||
((TrackRecordingActivity) getActivity()).chooseActivityType(category);
|
||||
}
|
||||
return true;
|
||||
});
|
||||
activityTypeIcon.setOnKeyListener((v, keyCode, event) -> {
|
||||
viewBinding.statsActivityTypeIcon.setOnKeyListener((v, keyCode, event) -> {
|
||||
if (keyCode == KeyEvent.KEYCODE_DPAD_CENTER) {
|
||||
((TrackRecordingActivity) getActivity()).chooseActivityType(category);
|
||||
}
|
||||
@@ -271,30 +269,28 @@ public class StatisticsRecordingFragment extends Fragment implements TrackDataLi
|
||||
private void updateSensorDataUI() {
|
||||
TrackRecordingServiceInterface trackRecordingService = trackRecordingServiceConnection.getServiceIfBound();
|
||||
|
||||
SensorDataSet sensorDataSet = null;
|
||||
Float elevationGain_m = null;
|
||||
if (trackRecordingService == null) {
|
||||
Log.d(TAG, "Cannot get the track recording service.");
|
||||
} else {
|
||||
sensorDataSet = trackRecordingService.getSensorData();
|
||||
elevationGain_m = trackRecordingService.getElevationGain_m();
|
||||
SensorDataSet sensorDataSet = trackRecordingService.getSensorData();
|
||||
if (sensorDataSet != null) {
|
||||
setHeartRateSensorData(sensorDataSet);
|
||||
setCadenceSensorData(sensorDataSet);
|
||||
setSpeedSensorData(sensorDataSet, isSelectedTrackRecording());
|
||||
}
|
||||
|
||||
setTotalElevationGain(trackRecordingService.getElevationGain_m());
|
||||
}
|
||||
|
||||
setHeartRateSensorData(sensorDataSet);
|
||||
setCadenceSensorData(sensorDataSet);
|
||||
setSpeedSensorData(sensorDataSet, isSelectedTrackRecording());
|
||||
|
||||
setTotalElevationGain(elevationGain_m);
|
||||
}
|
||||
|
||||
private void setHeartRateSensorData(SensorDataSet sensorDataSet) {
|
||||
int isVisible = sensorDataSet != null ? View.VISIBLE : View.GONE;
|
||||
int isVisible = sensorDataSet.getHeartRate() != null ? View.VISIBLE : View.GONE;
|
||||
viewBinding.statsSensorHeartRateGroup.setVisibility(isVisible);
|
||||
setVisibilitySensorHorizontalLine();
|
||||
|
||||
String sensorValue = getContext().getString(R.string.value_unknown);
|
||||
String sensorName = getContext().getString(R.string.value_unknown);
|
||||
if (sensorDataSet != null && sensorDataSet.getHeartRate() != null) {
|
||||
if (sensorDataSet.getHeartRate() != null) {
|
||||
SensorDataHeartRate data = sensorDataSet.getHeartRate();
|
||||
|
||||
sensorName = data.getSensorNameOrAddress();
|
||||
@@ -308,13 +304,13 @@ public class StatisticsRecordingFragment extends Fragment implements TrackDataLi
|
||||
}
|
||||
|
||||
private void setCadenceSensorData(SensorDataSet sensorDataSet) {
|
||||
int isVisible = sensorDataSet != null ? View.VISIBLE : View.GONE;
|
||||
int isVisible = sensorDataSet.getCyclingCadence() != null ? View.VISIBLE : View.GONE;
|
||||
viewBinding.statsSensorCadenceGroup.setVisibility(isVisible);
|
||||
setVisibilitySensorHorizontalLine();
|
||||
|
||||
String sensorValue = getContext().getString(R.string.value_unknown);
|
||||
String sensorName = getContext().getString(R.string.value_unknown);
|
||||
if (sensorDataSet != null && sensorDataSet.getCyclingCadence() != null) {
|
||||
if (sensorDataSet.getCyclingCadence() != null) {
|
||||
SensorDataCycling.Cadence data = sensorDataSet.getCyclingCadence();
|
||||
sensorName = data.getSensorNameOrAddress();
|
||||
|
||||
@@ -501,6 +497,6 @@ public class StatisticsRecordingFragment extends Fragment implements TrackDataLi
|
||||
|
||||
Pair<String, String> parts = StringUtils.getSpeedParts(getContext(), speed, metricUnits, reportSpeed);
|
||||
viewBinding.statsSpeedValue.setText(parts.first);
|
||||
viewBinding.statsSpeedLabel.setText(parts.second);
|
||||
viewBinding.statsSpeedUnit.setText(parts.second);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,16 +21,11 @@ import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.documentfile.provider.DocumentFile;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
|
||||
@@ -42,6 +37,7 @@ import de.dennisguse.opentracks.R;
|
||||
import de.dennisguse.opentracks.content.data.Track;
|
||||
import de.dennisguse.opentracks.content.data.TracksColumns;
|
||||
import de.dennisguse.opentracks.content.provider.ContentProviderUtils;
|
||||
import de.dennisguse.opentracks.databinding.ExportActivityBinding;
|
||||
import de.dennisguse.opentracks.io.file.ErrorListDialog;
|
||||
import de.dennisguse.opentracks.io.file.TrackFileFormat;
|
||||
import de.dennisguse.opentracks.util.ExportUtils;
|
||||
@@ -88,15 +84,7 @@ public class ExportActivity extends FragmentActivity implements ExportServiceRes
|
||||
|
||||
boolean doubleBackToCancel = false;
|
||||
|
||||
private TextView viewTotal;
|
||||
private TextView viewDone;
|
||||
private TextView viewSummary;
|
||||
private ProgressBar viewProgressBar;
|
||||
private ImageView viewAlertIcon;
|
||||
private TextView viewAlertMsg;
|
||||
private CheckBox viewDoItForAllSwitch;
|
||||
private Button viewLeftButton;
|
||||
private Button viewRightButton;
|
||||
private ExportActivityBinding viewBinding;
|
||||
|
||||
private ArrayList<String> trackErrors = new ArrayList<>();
|
||||
|
||||
@@ -105,10 +93,10 @@ public class ExportActivity extends FragmentActivity implements ExportServiceRes
|
||||
private ContentProviderUtils contentProviderUtils;
|
||||
|
||||
// List of tracks to be exported.
|
||||
private ArrayList<Track.Id> trackIds = new ArrayList<>();
|
||||
private final ArrayList<Track.Id> trackIds = new ArrayList<>();
|
||||
|
||||
private LinkedBlockingQueue<PendingConflict> conflictsQueue = new LinkedBlockingQueue<>();
|
||||
private Handler conflictsHandler = new Handler();
|
||||
private final LinkedBlockingQueue<PendingConflict> conflictsQueue = new LinkedBlockingQueue<>();
|
||||
private final Handler conflictsHandler = new Handler();
|
||||
|
||||
private final Runnable conflictsRunnable = new Runnable() {
|
||||
@Override
|
||||
@@ -123,7 +111,7 @@ public class ExportActivity extends FragmentActivity implements ExportServiceRes
|
||||
return;
|
||||
}
|
||||
|
||||
viewLeftButton.setOnClickListener((view) -> {
|
||||
viewBinding.exportProgressLeftButton.setOnClickListener((view) -> {
|
||||
setConflictVisibility(View.GONE);
|
||||
conflict.skip();
|
||||
conflictsQueue.remove(conflict);
|
||||
@@ -132,7 +120,7 @@ public class ExportActivity extends FragmentActivity implements ExportServiceRes
|
||||
}
|
||||
});
|
||||
|
||||
viewRightButton.setOnClickListener((view) -> {
|
||||
viewBinding.exportProgressRightButton.setOnClickListener((view) -> {
|
||||
setConflictVisibility(View.GONE);
|
||||
conflict.overwrite();
|
||||
conflictsQueue.remove(conflict);
|
||||
@@ -147,7 +135,7 @@ public class ExportActivity extends FragmentActivity implements ExportServiceRes
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.export_progress_activity);
|
||||
viewBinding = ExportActivityBinding.inflate(getLayoutInflater());
|
||||
|
||||
directoryUri = getIntent().getParcelableExtra(EXTRA_DIRECTORY_URI_KEY);
|
||||
trackFileFormat = (TrackFileFormat) getIntent().getSerializableExtra(EXTRA_TRACKFILEFORMAT_KEY);
|
||||
@@ -162,16 +150,6 @@ public class ExportActivity extends FragmentActivity implements ExportServiceRes
|
||||
|
||||
resultReceiver = new ExportServiceResultReceiver(new Handler(), this);
|
||||
|
||||
viewTotal = findViewById(R.id.export_progress_total);
|
||||
viewDone = findViewById(R.id.export_progress_done);
|
||||
viewSummary = findViewById(R.id.export_progress_summary);
|
||||
viewProgressBar = findViewById(R.id.export_progress_bar);
|
||||
viewAlertIcon = findViewById(R.id.export_progress_alert_icon);
|
||||
viewAlertMsg = findViewById(R.id.export_progress_alert_msg);
|
||||
viewDoItForAllSwitch = findViewById(R.id.export_progress_toggle);
|
||||
viewLeftButton = findViewById(R.id.export_progress_left_button);
|
||||
viewRightButton = findViewById(R.id.export_progress_right_button);
|
||||
|
||||
if (savedInstanceState == null) {
|
||||
autoConflict = CONFLICT_NONE;
|
||||
setProgress();
|
||||
@@ -235,10 +213,10 @@ public class ExportActivity extends FragmentActivity implements ExportServiceRes
|
||||
}
|
||||
|
||||
trackExportTotalCount = cursor.getCount();
|
||||
viewTotal.setText("" + trackExportTotalCount);
|
||||
viewBinding.exportProgressTotal.setText("" + trackExportTotalCount);
|
||||
for (int i = from; i < trackExportTotalCount; i++) {
|
||||
cursor.moveToPosition(i);
|
||||
Track track = contentProviderUtils.createTrack(cursor);
|
||||
Track track = ContentProviderUtils.createTrack(cursor);
|
||||
trackIds.add(track.getId());
|
||||
}
|
||||
|
||||
@@ -274,11 +252,11 @@ public class ExportActivity extends FragmentActivity implements ExportServiceRes
|
||||
}
|
||||
|
||||
private void setConflictVisibility(int visibility) {
|
||||
viewAlertIcon.setVisibility(visibility);
|
||||
viewAlertMsg.setVisibility(visibility);
|
||||
viewDoItForAllSwitch.setVisibility(visibility);
|
||||
viewLeftButton.setVisibility(visibility);
|
||||
viewRightButton.setVisibility(visibility);
|
||||
viewBinding.exportProgressAlertIcon.setVisibility(visibility);
|
||||
viewBinding.exportProgressAlertMsg.setVisibility(visibility);
|
||||
viewBinding.exportProgressApplyToAll.setVisibility(visibility);
|
||||
viewBinding.exportProgressLeftButton.setVisibility(visibility);
|
||||
viewBinding.exportProgressRightButton.setVisibility(visibility);
|
||||
}
|
||||
|
||||
private int getTotalDone() {
|
||||
@@ -288,11 +266,11 @@ public class ExportActivity extends FragmentActivity implements ExportServiceRes
|
||||
private void setProgress() {
|
||||
int done = getTotalDone();
|
||||
|
||||
viewDone.setText("" + done);
|
||||
viewTotal.setText("" + trackExportTotalCount);
|
||||
viewBinding.exportProgressDone.setText("" + done);
|
||||
viewBinding.exportProgressTotal.setText("" + trackExportTotalCount);
|
||||
|
||||
viewProgressBar.setProgress((int) ((float) done / (float) trackExportTotalCount * 100f));
|
||||
viewSummary.setText(getString(R.string.export_progress_review, getTotalDone(), trackExportSuccessCount, trackExportOverwrittenCount, trackExportSkippedCount, trackExportErrorCount));
|
||||
viewBinding.exportProgressBar.setProgress((int) ((float) done / (float) trackExportTotalCount * 100f));
|
||||
viewBinding.exportProgressSummary.setText(getString(R.string.export_progress_review, getTotalDone(), trackExportSuccessCount, trackExportOverwrittenCount, trackExportSkippedCount, trackExportErrorCount));
|
||||
}
|
||||
|
||||
private void onExportCompleted(Track.Id trackId) {
|
||||
@@ -306,25 +284,25 @@ public class ExportActivity extends FragmentActivity implements ExportServiceRes
|
||||
}
|
||||
|
||||
private void onExportEnded() {
|
||||
viewAlertIcon.setVisibility(View.VISIBLE);
|
||||
viewAlertMsg.setVisibility(View.VISIBLE);
|
||||
viewRightButton.setVisibility(View.VISIBLE);
|
||||
viewRightButton.setText(getString(R.string.generic_ok));
|
||||
viewBinding.exportProgressRightButton.setVisibility(View.VISIBLE);
|
||||
viewBinding.exportProgressRightButton.setText(getString(R.string.generic_ok));
|
||||
viewBinding.exportProgressRightButton.setOnClickListener((view) -> finish());
|
||||
|
||||
viewBinding.exportProgressAlertIcon.setVisibility(View.VISIBLE);
|
||||
viewBinding.exportProgressAlertMsg.setVisibility(View.VISIBLE);
|
||||
if (trackExportErrorCount > 0) {
|
||||
viewLeftButton.setVisibility(View.VISIBLE);
|
||||
viewLeftButton.setText(getString(R.string.generic_show_errors));
|
||||
viewLeftButton.setOnClickListener((view) -> ErrorListDialog.showDialog(getSupportFragmentManager(), getString(R.string.export_track_errors), trackErrors));
|
||||
viewAlertIcon.setImageDrawable(getDrawable(R.drawable.ic_report_problem_24));
|
||||
viewBinding.exportProgressLeftButton.setVisibility(View.VISIBLE);
|
||||
viewBinding.exportProgressLeftButton.setText(getString(R.string.generic_show_errors));
|
||||
viewBinding.exportProgressLeftButton.setOnClickListener((view) -> ErrorListDialog.showDialog(getSupportFragmentManager(), getString(R.string.export_track_errors), trackErrors));
|
||||
viewBinding.exportProgressAlertIcon.setImageDrawable(ContextCompat.getDrawable(this, R.drawable.ic_report_problem_24));
|
||||
String msg = getResources().getQuantityString(R.plurals.generic_completed_with_errors, trackExportErrorCount, trackExportErrorCount);
|
||||
viewAlertMsg.setText(msg);
|
||||
viewBinding.exportProgressAlertMsg.setText(msg);
|
||||
} else {
|
||||
viewLeftButton.setVisibility(View.GONE);
|
||||
viewAlertIcon.setImageDrawable(getDrawable(R.drawable.ic_dialog_success_24dp));
|
||||
viewAlertMsg.setText(getString(R.string.generic_completed));
|
||||
viewBinding.exportProgressLeftButton.setVisibility(View.GONE);
|
||||
viewBinding.exportProgressAlertIcon.setImageDrawable(ContextCompat.getDrawable(this, R.drawable.ic_dialog_success_24dp));
|
||||
viewBinding.exportProgressAlertMsg.setText(getString(R.string.generic_completed));
|
||||
}
|
||||
|
||||
viewRightButton.setOnClickListener((view) -> finish());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -368,7 +346,7 @@ public class ExportActivity extends FragmentActivity implements ExportServiceRes
|
||||
* Handle conflicts (exporting file already exists).
|
||||
*/
|
||||
private class PendingConflict {
|
||||
private Track.Id trackId;
|
||||
private final Track.Id trackId;
|
||||
|
||||
public PendingConflict(Track.Id trackId) {
|
||||
this.trackId = trackId;
|
||||
@@ -383,8 +361,8 @@ public class ExportActivity extends FragmentActivity implements ExportServiceRes
|
||||
public boolean resolve() {
|
||||
if (autoConflict == CONFLICT_NONE) {
|
||||
Track track = contentProviderUtils.getTrack(trackId);
|
||||
viewAlertIcon.setImageDrawable(getDrawable(R.drawable.ic_report_problem_24));
|
||||
viewAlertMsg.setText(getString(R.string.export_track_already_exists_msg, track.getName()));
|
||||
viewBinding.exportProgressAlertIcon.setImageDrawable(getDrawable(R.drawable.ic_report_problem_24));
|
||||
viewBinding.exportProgressAlertMsg.setText(getString(R.string.export_track_already_exists_msg, track.getName()));
|
||||
setConflictVisibility(View.VISIBLE);
|
||||
return false;
|
||||
}
|
||||
@@ -399,7 +377,7 @@ public class ExportActivity extends FragmentActivity implements ExportServiceRes
|
||||
public void overwrite() {
|
||||
export(trackId, CONFLICT_OVERWRITE);
|
||||
|
||||
if (viewDoItForAllSwitch.isChecked()) {
|
||||
if (viewBinding.exportProgressApplyToAll.isChecked()) {
|
||||
autoConflict = CONFLICT_OVERWRITE;
|
||||
}
|
||||
}
|
||||
@@ -410,7 +388,7 @@ public class ExportActivity extends FragmentActivity implements ExportServiceRes
|
||||
public void skip() {
|
||||
export(trackId, CONFLICT_SKIP);
|
||||
|
||||
if (viewDoItForAllSwitch.isChecked()) {
|
||||
if (viewBinding.exportProgressApplyToAll.isChecked()) {
|
||||
autoConflict = CONFLICT_SKIP;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,10 +20,6 @@ import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
@@ -33,6 +29,7 @@ import androidx.fragment.app.FragmentActivity;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
|
||||
import de.dennisguse.opentracks.R;
|
||||
import de.dennisguse.opentracks.databinding.ImportActivityBinding;
|
||||
import de.dennisguse.opentracks.io.file.ErrorListDialog;
|
||||
|
||||
/**
|
||||
@@ -50,14 +47,7 @@ public class ImportActivity extends FragmentActivity {
|
||||
private static final String BUNDLE_DOCUMENT_URI = "document_uri";
|
||||
private static final String BUNDLE_IS_DIRECTORY = "is_directory";
|
||||
|
||||
private TextView viewTotal;
|
||||
private TextView viewDone;
|
||||
private TextView viewSummary;
|
||||
private ProgressBar viewProgressBar;
|
||||
private ImageView viewAlertIcon;
|
||||
private TextView viewAlertMsg;
|
||||
private Button viewLeftButton;
|
||||
private Button viewRightButton;
|
||||
private ImportActivityBinding viewBinding;
|
||||
|
||||
boolean doubleBackToCancel = false;
|
||||
|
||||
@@ -71,21 +61,12 @@ public class ImportActivity extends FragmentActivity {
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.import_progress_activity);
|
||||
viewBinding = ImportActivityBinding.inflate(getLayoutInflater());
|
||||
setContentView(viewBinding.getRoot());
|
||||
|
||||
Toolbar toolbar = findViewById(R.id.toolbar);
|
||||
|
||||
viewTotal = findViewById(R.id.import_progress_total);
|
||||
viewDone = findViewById(R.id.import_progress_done);
|
||||
viewSummary = findViewById(R.id.import_progress_summary);
|
||||
viewProgressBar = findViewById(R.id.import_progress_bar);
|
||||
viewAlertIcon = findViewById(R.id.import_progress_alert_icon);
|
||||
viewAlertMsg = findViewById(R.id.import_progress_alert_msg);
|
||||
viewLeftButton = findViewById(R.id.import_progress_left_button);
|
||||
viewRightButton = findViewById(R.id.import_progress_right_button);
|
||||
|
||||
final DocumentFile documentFile;
|
||||
|
||||
if (savedInstanceState == null) {
|
||||
if (getIntent().getData() != null) {
|
||||
documentUri = getIntent().getData();
|
||||
@@ -143,9 +124,9 @@ public class ImportActivity extends FragmentActivity {
|
||||
}
|
||||
|
||||
private void initViews() {
|
||||
viewDone.setText("0");
|
||||
viewTotal.setText("0");
|
||||
viewSummary.setText(getString(R.string.import_progress_review, 0, 0, 0, 0));
|
||||
viewBinding.importProgressDone.setText("0");
|
||||
viewBinding.importProgressTotal.setText("0");
|
||||
viewBinding.importProgressSummary.setText(getString(R.string.import_progress_review, 0, 0, 0, 0));
|
||||
}
|
||||
|
||||
private int getTotalDone() {
|
||||
@@ -155,11 +136,11 @@ public class ImportActivity extends FragmentActivity {
|
||||
private void setProgress() {
|
||||
int done = getTotalDone();
|
||||
|
||||
viewDone.setText("" + done);
|
||||
viewTotal.setText("" + summary.getTotalCount());
|
||||
viewBinding.importProgressDone.setText("" + done);
|
||||
viewBinding.importProgressTotal.setText("" + summary.getTotalCount());
|
||||
|
||||
viewProgressBar.setProgress((int) ((float) done / (float) summary.getTotalCount() * 100f));
|
||||
viewSummary.setText(getString(R.string.import_progress_review, getTotalDone(), summary.getSuccessCount(), summary.getExistsCount(), summary.getErrorCount()));
|
||||
viewBinding.importProgressBar.setProgress((int) ((float) done / (float) summary.getTotalCount() * 100f));
|
||||
viewBinding.importProgressSummary.setText(getString(R.string.import_progress_review, getTotalDone(), summary.getSuccessCount(), summary.getExistsCount(), summary.getErrorCount()));
|
||||
|
||||
if (done == summary.getTotalCount()) {
|
||||
onImportEnded();
|
||||
@@ -167,27 +148,26 @@ public class ImportActivity extends FragmentActivity {
|
||||
}
|
||||
|
||||
private void onImportEnded() {
|
||||
viewAlertIcon.setVisibility(View.VISIBLE);
|
||||
viewAlertMsg.setVisibility(View.VISIBLE);
|
||||
viewRightButton.setVisibility(View.VISIBLE);
|
||||
viewRightButton.setText(getString(R.string.generic_ok));
|
||||
|
||||
if (summary.getErrorCount() > 0) {
|
||||
viewLeftButton.setVisibility(View.VISIBLE);
|
||||
viewLeftButton.setText(getString(R.string.generic_show_errors));
|
||||
viewLeftButton.setOnClickListener((view) -> ErrorListDialog.showDialog(getSupportFragmentManager(), getString(R.string.import_error_list_dialog_title), summary.getFileErrors()));
|
||||
viewAlertIcon.setImageDrawable(getDrawable(R.drawable.ic_report_problem_24));
|
||||
String msg = getResources().getQuantityString(R.plurals.generic_completed_with_errors, summary.getErrorCount(), summary.getErrorCount());
|
||||
viewAlertMsg.setText(msg);
|
||||
} else {
|
||||
viewLeftButton.setVisibility(View.GONE);
|
||||
viewAlertIcon.setImageDrawable(getDrawable(R.drawable.ic_dialog_success_24dp));
|
||||
viewAlertMsg.setText(getString(R.string.generic_completed));
|
||||
}
|
||||
|
||||
viewRightButton.setOnClickListener((view) -> {
|
||||
viewBinding.importProgressRightButton.setVisibility(View.VISIBLE);
|
||||
viewBinding.importProgressRightButton.setText(getString(R.string.generic_ok));
|
||||
viewBinding.importProgressRightButton.setOnClickListener((view) -> {
|
||||
getViewModelStore().clear();
|
||||
finish();
|
||||
});
|
||||
|
||||
viewBinding.importProgressAlertMsg.setVisibility(View.VISIBLE);
|
||||
viewBinding.importProgressAlertIcon.setVisibility(View.VISIBLE);
|
||||
if (summary.getErrorCount() > 0) {
|
||||
viewBinding.importProgressLeftButton.setVisibility(View.VISIBLE);
|
||||
viewBinding.importProgressLeftButton.setText(getString(R.string.generic_show_errors));
|
||||
viewBinding.importProgressLeftButton.setOnClickListener((view) -> ErrorListDialog.showDialog(getSupportFragmentManager(), getString(R.string.import_error_list_dialog_title), summary.getFileErrors()));
|
||||
viewBinding.importProgressAlertIcon.setImageDrawable(getDrawable(R.drawable.ic_report_problem_24));
|
||||
String msg = getResources().getQuantityString(R.plurals.generic_completed_with_errors, summary.getErrorCount(), summary.getErrorCount());
|
||||
viewBinding.importProgressAlertMsg.setText(msg);
|
||||
} else {
|
||||
viewBinding.importProgressLeftButton.setVisibility(View.GONE);
|
||||
viewBinding.importProgressAlertIcon.setImageDrawable(getDrawable(R.drawable.ic_dialog_success_24dp));
|
||||
viewBinding.importProgressAlertMsg.setText(getString(R.string.generic_completed));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,6 +56,7 @@ public class ActivityTypePreference extends DialogPreference {
|
||||
|
||||
@Override
|
||||
public int getDialogLayoutResource() {
|
||||
// TODO PreferenceActivityTypeBinding
|
||||
return R.layout.preference_activity_type;
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,9 @@ limitations under the License.
|
||||
android:baselineAligned="false"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<include layout="@layout/track_controller" />
|
||||
<include
|
||||
android:id="@+id/track_controller_container"
|
||||
layout="@layout/track_controller" />
|
||||
|
||||
<ListView
|
||||
android:id="@+id/track_list"
|
||||
|
||||
+3
-1
@@ -11,7 +11,9 @@
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<include layout="@layout/track_controller" />
|
||||
<include
|
||||
android:id="@+id/track_controller_container"
|
||||
layout="@layout/track_controller" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
+2
-2
@@ -100,7 +100,7 @@
|
||||
android:layout_marginTop="24dp"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:layout_marginBottom="24dp"
|
||||
app:layout_constraintBottom_toTopOf="@id/export_progress_toggle"
|
||||
app:layout_constraintBottom_toTopOf="@id/export_progress_apply_to_all"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/export_progress_alert_icon"
|
||||
app:layout_constraintTop_toBottomOf="@id/export_progress_summary"
|
||||
@@ -108,7 +108,7 @@
|
||||
tools:text="The track already exists" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/export_progress_toggle"
|
||||
android:id="@+id/export_progress_apply_to_all"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="24dp"
|
||||
@@ -83,5 +83,7 @@ limitations under the License.
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
<include layout="@layout/track_controller" />
|
||||
<include
|
||||
android:id="@+id/track_controller_container"
|
||||
layout="@layout/track_controller" />
|
||||
</LinearLayout>
|
||||
@@ -17,5 +17,7 @@
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<include layout="@layout/track_controller" />
|
||||
<include
|
||||
android:id="@+id/track_controller_container"
|
||||
layout="@layout/track_controller" />
|
||||
</LinearLayout>
|
||||
Reference in New Issue
Block a user