Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion app/src/fdroid/java/io/pslab/activity/MapsActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.content.res.ResourcesCompat;

import org.json.JSONArray;
import org.json.JSONException;
Expand Down Expand Up @@ -58,7 +59,7 @@ private void addMarkers(JSONArray markers) throws JSONException {
JSONObject marker = markers.getJSONObject(i);
m.setPosition(new GeoPoint(marker.getDouble("lat"), marker.getDouble("lon")));
m.setTitle(marker.getString("data") + " @ " + marker.getString("date"));
m.setIcon(getResources().getDrawable(R.drawable.action_item_read));
m.setIcon(ResourcesCompat.getDrawable(getResources(), R.drawable.action_item_read, null));
m.setAnchor(Marker.ANCHOR_CENTER, Marker.ANCHOR_TOP);
map.getOverlays().add(m);
}
Expand Down
10 changes: 6 additions & 4 deletions app/src/main/java/io/pslab/activity/MultimeterActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
import androidx.coordinatorlayout.widget.CoordinatorLayout;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
import androidx.core.content.res.ResourcesCompat;

import android.view.GestureDetector;
import android.view.Menu;
import android.view.MenuInflater;
Expand Down Expand Up @@ -565,13 +567,13 @@ public void onClick(View view) {
if (playClicked) {
playClicked = false;
stopMenu.setVisible(true);
item.setIcon(getResources().getDrawable(R.drawable.ic_play_arrow_white_24dp));
item.setIcon(ResourcesCompat.getDrawable(getResources(), R.drawable.ic_play_arrow_white_24dp, null));
if (playBackTimer != null) {
playBackTimer.cancel();
}
} else {
playClicked = true;
item.setIcon(getResources().getDrawable(R.drawable.ic_pause_white_24dp));
item.setIcon(ResourcesCompat.getDrawable(getResources(), R.drawable.ic_pause_white_24dp, null));
stopMenu.setVisible(true);
if (playBackTimer != null) {
playBackTimer.cancel();
Expand All @@ -590,7 +592,7 @@ public void run() {
playBackTimer.cancel();
currentPosition = 0;
stopMenu.setVisible(false);
item.setIcon(getResources().getDrawable(R.drawable.ic_play_arrow_white_24dp));
item.setIcon(ResourcesCompat.getDrawable(getResources(), R.drawable.ic_play_arrow_white_24dp, null));
}
}
});
Expand All @@ -606,7 +608,7 @@ public void run() {
}
currentPosition = 0;
playClicked = false;
playMenu.setIcon(getResources().getDrawable(R.drawable.ic_play_arrow_white_24dp));
playMenu.setIcon(ResourcesCompat.getDrawable(getResources(), R.drawable.ic_play_arrow_white_24dp, null));
default:
break;
}
Expand Down
13 changes: 7 additions & 6 deletions app/src/main/java/io/pslab/activity/PowerSourceActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.coordinatorlayout.widget.CoordinatorLayout;
import androidx.core.content.res.ResourcesCompat;
import androidx.core.widget.TextViewCompat;
import android.view.GestureDetector;
import android.view.KeyEvent;
Expand Down Expand Up @@ -451,7 +452,7 @@ public boolean onOptionsItemSelected(MenuItem item) {
break;
case R.id.power_source_record_data:
if (!isRecording) {
item.setIcon(getResources().getDrawable(R.drawable.ic_record_stop_white));
item.setIcon(ResourcesCompat.getDrawable(getResources(), R.drawable.ic_record_stop_white, null));
isRecording = true;
if (recordTimer == null) {
recordTimer = new Timer();
Expand All @@ -474,7 +475,7 @@ public void run() {
}
}, 0, recordPeriod);
} else {
item.setIcon(getResources().getDrawable(R.drawable.ic_record_white));
item.setIcon(ResourcesCompat.getDrawable(getResources(), R.drawable.ic_record_white, null));
recordTimer.cancel();
recordTimer = null;
isRecording = false;
Expand All @@ -496,7 +497,7 @@ public void onClick(View view) {
if (!playClicked) {
playClicked = true;
stopMenu.setVisible(true);
item.setIcon(getResources().getDrawable(R.drawable.ic_pause_white_24dp));
item.setIcon(ResourcesCompat.getDrawable(getResources(), R.drawable.ic_pause_white_24dp, null));
if (playbackTimer == null) {
playbackTimer = new Timer();
} else {
Expand All @@ -517,7 +518,7 @@ public void run() {
currentPosition = 0;
playClicked = false;
stopMenu.setVisible(false);
item.setIcon(getResources().getDrawable(R.drawable.ic_play_arrow_white_24dp));
item.setIcon(ResourcesCompat.getDrawable(getResources(), R.drawable.ic_play_arrow_white_24dp, null));
}
}
});
Expand All @@ -527,7 +528,7 @@ public void run() {
} else {
playClicked = false;
stopMenu.setVisible(false);
item.setIcon(getResources().getDrawable(R.drawable.ic_play_arrow_white_24dp));
item.setIcon(ResourcesCompat.getDrawable(getResources(), R.drawable.ic_play_arrow_white_24dp, null));
if (playbackTimer != null) {
playbackTimer.cancel();
playbackTimer = null;
Expand All @@ -539,7 +540,7 @@ public void run() {
playbackTimer.cancel();
currentPosition = 0;
playClicked = false;
playMenu.setIcon(getResources().getDrawable(R.drawable.ic_play_arrow_white_24dp));
playMenu.setIcon(ResourcesCompat.getDrawable(getResources(), R.drawable.ic_play_arrow_white_24dp, null));
stopMenu.setVisible(false);
}
break;
Expand Down
7 changes: 4 additions & 3 deletions app/src/main/java/io/pslab/activity/RoboticArmActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.core.content.res.ResourcesCompat;

import com.google.android.material.bottomsheet.BottomSheetBehavior;
import com.google.android.material.snackbar.Snackbar;
Expand Down Expand Up @@ -728,11 +729,11 @@ public boolean onOptionsItemSelected(MenuItem item) {
case R.id.play_data:
if (isPlaying) {
isPlaying = false;
item.setIcon(getResources().getDrawable(R.drawable.ic_play_arrow_white_24dp));
item.setIcon(ResourcesCompat.getDrawable(getResources(), R.drawable.ic_play_arrow_white_24dp, null));
timeLine.onFinish();
} else {
isPlaying = true;
item.setIcon(getResources().getDrawable(R.drawable.ic_pause_white_24dp));
item.setIcon(ResourcesCompat.getDrawable(getResources(), R.drawable.ic_pause_white_24dp, null));
timeLine.start();
}
break;
Expand All @@ -742,7 +743,7 @@ public boolean onOptionsItemSelected(MenuItem item) {
timeIndicatorLayout.setLayoutParams(timeIndicatorParams);
scrollView.fullScroll(HorizontalScrollView.FOCUS_LEFT);
isPlaying = false;
playMenu.setIcon(getResources().getDrawable(R.drawable.ic_play_arrow_white_24dp));
playMenu.setIcon(ResourcesCompat.getDrawable(getResources(), R.drawable.ic_play_arrow_white_24dp, null));
timelinePosition = 0;
break;
case R.id.show_guide:
Expand Down
Loading