This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RestAdapter restAdapter = RestApi.init(this, sCurrentUrl); | |
final ServiceApi serverApi = restAdapter.create(ServiceApi.class); | |
mServiceApi = (ServiceApi) Proxy.newProxyInstance(ServiceApi.class.getClassLoader(), new Class<?>[]{ServiceApi.class}, | |
new InvocationHandler() | |
{ | |
@Override | |
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable | |
{ | |
final Method serviceApiMethod = serviceApi.getClass().getMethod(method.getName(), method.getParameterTypes()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static class InlineConverter extends GsonConverter | |
{ | |
private static String sGuid = null; | |
private static final String CHARSET = "UTF-8"; | |
private final RequestHeader mRequestHeader; | |
private final DeviceGuid mDeviceGuid; | |
private final Gson mGson; | |
public InlineConverter(Gson gson, String appVersion) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.altaine.wagamama.ui.fragment; | |
import android.os.Bundle; | |
import android.support.annotation.Nullable; | |
import android.support.v4.app.Fragment; | |
import android.view.LayoutInflater; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import com.arellomobile.mvp.MvpDelegate; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.arellomobile.mvp; | |
import java.util.ArrayList; | |
import java.util.List; | |
import android.os.Bundle; | |
import com.arellomobile.mvp.presenter.PresenterType; | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package net.senneco.weatherapp.mvp.presenter; | |
import com.arellomobile.mvp.InjectViewState; | |
import com.arellomobile.mvp.MvpPresenter; | |
import net.senneco.weatherapp.app.WeatherApp; | |
import net.senneco.weatherapp.mvp.common.WeatherAppSchedulers; | |
import net.senneco.weatherapp.mvp.model.data.City; | |
import net.senneco.weatherapp.mvp.model.repository.Repository; | |
import net.senneco.weatherapp.mvp.view.CitiesView; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package net.senneco.devfest; | |
import android.os.Bundle; | |
import android.support.annotation.StringRes; | |
import android.view.View; | |
import android.widget.ProgressBar; | |
import android.widget.TextView; | |
import com.arellomobile.mvp.MvpAppCompatActivity; | |
import com.arellomobile.mvp.presenter.InjectPresenter; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class PlayerActivity extends MvpAppCompatActivity implements PlayerView { | |
@InjectPresenter | |
PlayerPresenter mPlayerPresenter; | |
Player mPlayer; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Watcher implements TextWatcher { | |
private static final char THOUSANDS_SEPARATOR = ' '; | |
private static final char FRACTION_SEPARATOR = ','; | |
private boolean mIsSpaceRemoved; | |
private int mRemovedSpacePosition; | |
private EditText mValueEditText; | |
private InputFilter[] mFilters; | |
public Watcher(EditText valueEditText) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class DefaultStateStrategy implements StateStrategy { | |
@Override | |
public <View extends MvpView> void beforeApply(List<ViewCommand<View>> currentState, ViewCommand<View> incomingCommand) { | |
MvpFacade.getDefaultStrategy().beforeApply(currentState, incomingCommand); | |
} | |
@Override | |
public <View extends MvpView> void afterApply(List<ViewCommand<View>> currentState, ViewCommand<View> incomingCommand) { | |
MvpFacade.getDefaultStrategy().afterApply(currentState, incomingCommand); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public abstract class ViewCommand<View extends MvpView> { | |
private final String mTag; | |
private final Class<? extends StateStrategy> mStateStrategyType; | |
protected ViewCommand(String tag) { | |
this(tag, MvpFacade.getDefaultStrategyClass()); | |
} | |
protected ViewCommand(String tag, Class<? extends StateStrategy> stateStrategyType) { | |
mTag = tag; |
OlderNewer