Permalink
Browse files

localize code to make it easier to read w/o external context

  • Loading branch information...
mythz committed Mar 22, 2017
1 parent f60ff62 commit 6519a920a8b9d4b316957d9833bfc0e8db18f224
@@ -20,8 +20,6 @@
*/
public class App extends Application {
public static final String BaseUrl = "http://chat.servicestack.net/";
private Context context;
private SharedPreferences prefs;
private AndroidServerEventsClient serverEventsClient;
@@ -34,15 +32,15 @@ protected int sizeOf(String key, Bitmap value) {
public App() {}
public App(Context context, String... channels) {
public App(Context context) {
this.context = context;
this.prefs = context.getSharedPreferences("servicestack.net.androidchat",Context.MODE_PRIVATE);
serverEventsClient = new AndroidServerEventsClient(BaseUrl, channels);
serverEventsClient = new AndroidServerEventsClient("http://chat.servicestack.net/", "home");
}
public void onCreate() {
super.onCreate();
instance = new App(getApplicationContext(), "home");
instance = new App(getApplicationContext());
}
public static App get() {
@@ -87,7 +87,7 @@ protected void onCreate(Bundle savedInstanceState) {
MainActivity mainActivity = this;
cmdReceiver = new ChatCommandHandler(mainActivity, messageHistoryAdapter, "home");
getClient()
App.get().getServerEventsClient()
.setOnConnect(connectMsg -> {
Extensions.updateChatHistory(getClient(), cmdReceiver, () -> {
Extensions.updateUserProfile(connectMsg, mainActivity);

0 comments on commit 6519a92

Please sign in to comment.