Commit 5d931e66 authored by Varun Patil's avatar Varun Patil

Fix offer image

parent f23c4afa
...@@ -58,8 +58,6 @@ public class GenericAdapter extends CardAdapter<CardInterface> { ...@@ -58,8 +58,6 @@ public class GenericAdapter extends CardAdapter<CardInterface> {
public int getAvatarPlaceholder(CardInterface cardInterface) { public int getAvatarPlaceholder(CardInterface cardInterface) {
if (cardInterface instanceof User) { if (cardInterface instanceof User) {
return R.drawable.user_placeholder; return R.drawable.user_placeholder;
} else if (cardInterface instanceof OfferedAchievement) {
return R.drawable.ic_done_all_black_256dp;
} }
return Utils.isDarkTheme ? R.drawable.lotus_placeholder_dark : R.drawable.lotus_placeholder; return Utils.isDarkTheme ? R.drawable.lotus_placeholder_dark : R.drawable.lotus_placeholder;
} }
......
...@@ -6,6 +6,7 @@ import com.google.gson.annotations.SerializedName; ...@@ -6,6 +6,7 @@ import com.google.gson.annotations.SerializedName;
import java.util.Objects; import java.util.Objects;
import app.insti.Utils;
import app.insti.interfaces.CardInterface; import app.insti.interfaces.CardInterface;
public class OfferedAchievement implements CardInterface { public class OfferedAchievement implements CardInterface {
...@@ -25,6 +26,9 @@ public class OfferedAchievement implements CardInterface { ...@@ -25,6 +26,9 @@ public class OfferedAchievement implements CardInterface {
@SerializedName("event") @SerializedName("event")
private String achievementEventId; private String achievementEventId;
@SerializedName("generic")
private String achievementGeneric;
@NonNull @NonNull
public String getAchievementID() { public String getAchievementID() {
return achievementID; return achievementID;
...@@ -87,6 +91,7 @@ public class OfferedAchievement implements CardInterface { ...@@ -87,6 +91,7 @@ public class OfferedAchievement implements CardInterface {
} }
public String getAvatarUrl() { public String getAvatarUrl() {
return null; return String.format("https://insti.app/assets/achievements/%s%s.png",
achievementGeneric, Utils.isDarkTheme ? "_dark" : "");
} }
} }
...@@ -191,6 +191,8 @@ public class EventFragment extends BackHandledFragment implements TransitionTarg ...@@ -191,6 +191,8 @@ public class EventFragment extends BackHandledFragment implements TransitionTarg
* Set appbar to have an offset * Set appbar to have an offset
*/ */
private void setAppBarOffset(int offsetPx) { private void setAppBarOffset(int offsetPx) {
if (getView() == null || getActivity() == null) return;
AppBarLayout mAppBarLayout = getView().findViewById(R.id.appBar); AppBarLayout mAppBarLayout = getView().findViewById(R.id.appBar);
CoordinatorLayout mCoordinatorLayour = getView().findViewById(R.id.coordinator); CoordinatorLayout mCoordinatorLayour = getView().findViewById(R.id.coordinator);
CoordinatorLayout.LayoutParams params = (CoordinatorLayout.LayoutParams) mAppBarLayout.getLayoutParams(); CoordinatorLayout.LayoutParams params = (CoordinatorLayout.LayoutParams) mAppBarLayout.getLayoutParams();
...@@ -200,6 +202,8 @@ public class EventFragment extends BackHandledFragment implements TransitionTarg ...@@ -200,6 +202,8 @@ public class EventFragment extends BackHandledFragment implements TransitionTarg
} }
private void refreshEvent(Event min_event) { private void refreshEvent(Event min_event) {
if (getView() == null || getActivity() == null) return;
RetrofitInterface retrofitInterface = Utils.getRetrofitInterface(); RetrofitInterface retrofitInterface = Utils.getRetrofitInterface();
retrofitInterface.getEvent(Utils.getSessionIDHeader(), min_event.getEventID()).enqueue(new EmptyCallback<Event>() { retrofitInterface.getEvent(Utils.getSessionIDHeader(), min_event.getEventID()).enqueue(new EmptyCallback<Event>() {
@Override @Override
......
...@@ -143,6 +143,7 @@ public class WebViewFragment extends BaseFragment { ...@@ -143,6 +143,7 @@ public class WebViewFragment extends BaseFragment {
public void onStop() { public void onStop() {
if (mCameraSource != null) { if (mCameraSource != null) {
mCameraSource.release(); mCameraSource.release();
mCameraSource = null;
} }
super.onStop(); super.onStop();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment