Preyea Regmi
5 years ago
6 changed files with 169 additions and 83 deletions
-
13app/src/main/java/com/gmeremit/online/gmeremittance_native/customer_support/view/CustomerSupportFragment.java
-
45app/src/main/java/com/gmeremit/online/gmeremittance_native/homeV2/view/HomeActivityV2.java
-
62app/src/main/java/com/gmeremit/online/gmeremittance_native/splash_screen/view/SplashScreen.java
-
82app/src/main/java/com/gmeremit/online/gmeremittance_native/utils/ChatUtils.java
-
46app/src/main/java/com/gmeremit/online/gmeremittance_native/utils/Utils.java
-
4app/src/main/res/layout/activity_splash_screen_key_0.xml
@ -0,0 +1,82 @@ |
|||
package com.gmeremit.online.gmeremittance_native.utils; |
|||
|
|||
import android.content.Context; |
|||
|
|||
import com.gmeremit.online.gmeremittance_native.GmeApplication; |
|||
import com.gmeremit.online.gmeremittance_native.R; |
|||
import com.gmeremit.online.gmeremittance_native.base.PrefKeys; |
|||
import com.zoyi.channel.plugin.android.ChannelPluginCompletionStatus; |
|||
import com.zoyi.channel.plugin.android.ChannelPluginSettings; |
|||
import com.zoyi.channel.plugin.android.Profile; |
|||
|
|||
public class ChatUtils { |
|||
|
|||
public static ChatInitData startChannelIoCredential(boolean isUserGuest) |
|||
{ |
|||
ChannelPluginSettings settings = new ChannelPluginSettings("24dc2dfd-3ed1-4953-b395-a2255ed41dae"); |
|||
settings.setUserId(GmeApplication.getStorage().getString(PrefKeys.USER_EMAIL,"")); |
|||
|
|||
|
|||
if(!isUserGuest) { |
|||
Profile profile = Profile.create() |
|||
.setName(GmeApplication.getStorage().getString(PrefKeys.USER_FIRST_NAME, "")) |
|||
.setEmail(GmeApplication.getStorage().getString(PrefKeys.USER_EMAIL, "")); |
|||
return new ChatInitData(profile,settings); |
|||
} |
|||
else |
|||
return new ChatInitData(null,settings); |
|||
|
|||
} |
|||
|
|||
public static class ChatInitData |
|||
{ |
|||
Profile profile; |
|||
ChannelPluginSettings channelPluginSettings; |
|||
|
|||
public ChatInitData(Profile profile, ChannelPluginSettings channelPluginSettings) { |
|||
this.profile = profile; |
|||
this.channelPluginSettings = channelPluginSettings; |
|||
} |
|||
|
|||
public Profile getProfile() { |
|||
return profile; |
|||
} |
|||
|
|||
public ChannelPluginSettings getChannelPluginSettings() { |
|||
return channelPluginSettings; |
|||
} |
|||
} |
|||
|
|||
|
|||
public static String errorMessage(ChannelPluginCompletionStatus status, Context context) |
|||
{ |
|||
String errorMessage = context.getString(R.string.channelIO_error_message_text); |
|||
switch (status) { |
|||
case NOT_INITIALIZED: |
|||
errorMessage += "(1)"; |
|||
break; |
|||
case NETWORK_TIMEOUT: |
|||
errorMessage += "(2)"; |
|||
break; |
|||
case NOT_AVAILABLE_VERSION: |
|||
errorMessage += "(3)"; |
|||
break; |
|||
case SERVICE_UNDER_CONSTRUCTION: |
|||
errorMessage += "(4)"; |
|||
break; |
|||
case REQUIRE_PAYMENT: |
|||
errorMessage += "(5)"; |
|||
break; |
|||
case ACCESS_DENIED: |
|||
errorMessage += "(6)"; |
|||
break; |
|||
case UNKNOWN_ERROR: |
|||
errorMessage += "(7)"; |
|||
break; |
|||
case SUCCESS: |
|||
errorMessage=null; |
|||
|
|||
} |
|||
return errorMessage; |
|||
} |
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue