дебил
This commit is contained in:
1
Android/BewoMitarbeiterApp/.idea/.name
generated
1
Android/BewoMitarbeiterApp/.idea/.name
generated
@@ -1 +0,0 @@
|
||||
BewoMitarbeiterApp
|
||||
229
Android/BewoMitarbeiterApp/.idea/codeStyleSettings.xml
generated
229
Android/BewoMitarbeiterApp/.idea/codeStyleSettings.xml
generated
@@ -1,229 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectCodeStyleSettingsManager">
|
||||
<option name="PER_PROJECT_SETTINGS">
|
||||
<value>
|
||||
<option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="99" />
|
||||
<option name="NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND" value="99" />
|
||||
<option name="PACKAGES_TO_USE_IMPORT_ON_DEMAND">
|
||||
<value />
|
||||
</option>
|
||||
<option name="IMPORT_LAYOUT_TABLE">
|
||||
<value>
|
||||
<package name="android" withSubpackages="true" static="false" />
|
||||
<emptyLine />
|
||||
<package name="com" withSubpackages="true" static="false" />
|
||||
<emptyLine />
|
||||
<package name="junit" withSubpackages="true" static="false" />
|
||||
<emptyLine />
|
||||
<package name="net" withSubpackages="true" static="false" />
|
||||
<emptyLine />
|
||||
<package name="org" withSubpackages="true" static="false" />
|
||||
<emptyLine />
|
||||
<package name="java" withSubpackages="true" static="false" />
|
||||
<emptyLine />
|
||||
<package name="javax" withSubpackages="true" static="false" />
|
||||
<emptyLine />
|
||||
<package name="" withSubpackages="true" static="false" />
|
||||
<emptyLine />
|
||||
<package name="" withSubpackages="true" static="true" />
|
||||
<emptyLine />
|
||||
</value>
|
||||
</option>
|
||||
<option name="RIGHT_MARGIN" value="100" />
|
||||
<AndroidXmlCodeStyleSettings>
|
||||
<option name="USE_CUSTOM_SETTINGS" value="true" />
|
||||
</AndroidXmlCodeStyleSettings>
|
||||
<Objective-C-extensions>
|
||||
<option name="GENERATE_INSTANCE_VARIABLES_FOR_PROPERTIES" value="ASK" />
|
||||
<option name="RELEASE_STYLE" value="IVAR" />
|
||||
<option name="TYPE_QUALIFIERS_PLACEMENT" value="BEFORE" />
|
||||
<file>
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Import" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Macro" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Typedef" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Enum" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Constant" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Global" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Struct" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="FunctionPredecl" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Function" />
|
||||
</file>
|
||||
<class>
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Property" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Synthesize" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InitMethod" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="StaticMethod" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InstanceMethod" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="DeallocMethod" />
|
||||
</class>
|
||||
<extensions>
|
||||
<pair source="cpp" header="h" />
|
||||
<pair source="c" header="h" />
|
||||
</extensions>
|
||||
</Objective-C-extensions>
|
||||
<XML>
|
||||
<option name="XML_LEGACY_SETTINGS_IMPORTED" value="true" />
|
||||
</XML>
|
||||
<codeStyleSettings language="XML">
|
||||
<option name="FORCE_REARRANGE_MODE" value="1" />
|
||||
<indentOptions>
|
||||
<option name="CONTINUATION_INDENT_SIZE" value="4" />
|
||||
</indentOptions>
|
||||
<arrangement>
|
||||
<rules>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>xmlns:android</NAME>
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>xmlns:.*</NAME>
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
<order>BY_NAME</order>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*:id</NAME>
|
||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*:name</NAME>
|
||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>name</NAME>
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>style</NAME>
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*</NAME>
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
<order>BY_NAME</order>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*:layout_width</NAME>
|
||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*:layout_height</NAME>
|
||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*:layout_.*</NAME>
|
||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
<order>BY_NAME</order>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*:width</NAME>
|
||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
<order>BY_NAME</order>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*:height</NAME>
|
||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
<order>BY_NAME</order>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*</NAME>
|
||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
<order>BY_NAME</order>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*</NAME>
|
||||
<XML_NAMESPACE>.*</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
<order>BY_NAME</order>
|
||||
</rule>
|
||||
</section>
|
||||
</rules>
|
||||
</arrangement>
|
||||
</codeStyleSettings>
|
||||
</value>
|
||||
</option>
|
||||
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Default (1)" />
|
||||
</component>
|
||||
</project>
|
||||
2
Android/BewoMitarbeiterApp/.idea/compiler.xml
generated
2
Android/BewoMitarbeiterApp/.idea/compiler.xml
generated
@@ -1,7 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CompilerConfiguration">
|
||||
<option name="DEFAULT_COMPILER" value="Javac" />
|
||||
<resourceExtensions />
|
||||
<wildcardResourcePatterns>
|
||||
<entry name="!?*.java" />
|
||||
@@ -12,6 +11,7 @@
|
||||
<entry name="!?*.flex" />
|
||||
<entry name="!?*.kt" />
|
||||
<entry name="!?*.clj" />
|
||||
<entry name="!?*.aj" />
|
||||
</wildcardResourcePatterns>
|
||||
<annotationProcessing>
|
||||
<profile default="true" name="Default" enabled="false">
|
||||
|
||||
6
Android/BewoMitarbeiterApp/.idea/encodings.xml
generated
6
Android/BewoMitarbeiterApp/.idea/encodings.xml
generated
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Encoding">
|
||||
<file url="PROJECT" charset="UTF-8" />
|
||||
</component>
|
||||
</project>
|
||||
2
Android/BewoMitarbeiterApp/.idea/misc.xml
generated
2
Android/BewoMitarbeiterApp/.idea/misc.xml
generated
@@ -37,7 +37,7 @@
|
||||
<ConfirmationsSetting value="0" id="Add" />
|
||||
<ConfirmationsSetting value="0" id="Remove" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<excludeFolder url="file://$MODULE_DIR$/.gradle" />
|
||||
</content>
|
||||
<orderEntry type="jdk" jdkName="Android API 23 Platform" jdkType="Android SDK" />
|
||||
<orderEntry type="jdk" jdkName="1.8" jdkType="JavaSDK" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
@@ -66,14 +66,6 @@
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/shaders" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" />
|
||||
@@ -82,9 +74,16 @@
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/jni" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/builds" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/appcompat-v7/21.0.3/jars" />
|
||||
@@ -100,6 +99,8 @@
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/instant-run-support" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jniLibs" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/multi-dex" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/pre-dexed" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/reload-dex" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/restart-dex" />
|
||||
|
||||
@@ -362,6 +362,8 @@ public class ChatActivity extends ActionBarActivity implements ConnectivityRecei
|
||||
adapter.sort(DATE_COMPARATOR);
|
||||
adapter.notifyDataSetChanged();
|
||||
|
||||
listView.setSelection(adapter.getCount() - 1);
|
||||
|
||||
text.setText("");
|
||||
}
|
||||
});
|
||||
@@ -458,6 +460,7 @@ public class ChatActivity extends ActionBarActivity implements ConnectivityRecei
|
||||
spiceManager.execute(request, new JsonSoapPrimitiveRequestListener(corruptedSpiceCallback, isInitialCall));
|
||||
}
|
||||
};
|
||||
|
||||
SocketManager.connectToServer("ChatActivity -> Letzter Serverkontakt ist länger als " + BeWoChatApplication.getRefreshIntervalInMinutes() + " Minuten her");
|
||||
}
|
||||
} else {
|
||||
@@ -668,13 +671,15 @@ public class ChatActivity extends ActionBarActivity implements ConnectivityRecei
|
||||
public void run() {
|
||||
chatMessages.addAll(result);
|
||||
adapter.sort(DATE_COMPARATOR);
|
||||
if(!isInitialCall) {
|
||||
try {
|
||||
listView.setSelection(0);
|
||||
} catch(Exception e) {
|
||||
Util.buildAlert(ChatActivity.this, "adapter.getCount() hat nicht funktioniert!");
|
||||
}
|
||||
}
|
||||
|
||||
// if(!isInitialCall) {
|
||||
// try {
|
||||
// listView.setSelection(0);
|
||||
// } catch(Exception e) {
|
||||
// Util.buildAlert(ChatActivity.this, "adapter.getCount() hat nicht funktioniert!");
|
||||
// }
|
||||
// }
|
||||
|
||||
adapter.notifyDataSetChanged();
|
||||
}
|
||||
});
|
||||
@@ -737,61 +742,6 @@ public class ChatActivity extends ActionBarActivity implements ConnectivityRecei
|
||||
}
|
||||
}
|
||||
|
||||
private final class JsonSoapChunkRequestListener implements RequestListener<SoapPrimitive> {
|
||||
|
||||
@Override
|
||||
public void onRequestFailure(SpiceException spiceException) {
|
||||
BeWoLog.writeToLogFile("Das Chunkweise Laden der Nachrichten ist fehlgeschlagen. (ChatActivity->JsonSoapChunkRequestListener->onRequestFailure)");
|
||||
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Toast.makeText(ChatActivity.this, "Ein Fehler ist beim chunkweise Laden der Nachrichten auftegreten.", Toast.LENGTH_LONG).show();
|
||||
}
|
||||
});
|
||||
|
||||
Log.e("GET_ALL_MESSAGES", "Das Chunkweise Laden der Nachrichten ist gescheitert: " + spiceException.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRequestSuccess(SoapPrimitive soapPrimitive) {
|
||||
BeWoLog.writeToLogFile("Das chunkweise Laden der Nachrichten war erfolgreich. (ChatActivty, wo sonst?)");
|
||||
|
||||
BeWoChatApplication.lastOnlineTS = Calendar.getInstance().getTime();
|
||||
|
||||
GsonBuilder builder = new GsonBuilder();
|
||||
builder.registerTypeAdapter(ChatMessage.class, new ChatMessageDeserializer());
|
||||
|
||||
Gson gson = builder.create();
|
||||
|
||||
Type listType = new TypeToken<ArrayList<ChatMessage>>(){}.getType();
|
||||
|
||||
final ArrayList<ChatMessage> result = gson.fromJson(soapPrimitive.toString(), listType);
|
||||
|
||||
String abc = "Chunkweise geladenen Nachrichten:\n";
|
||||
for(ChatMessage m : result) {
|
||||
abc += m.MessageId + ": " + m.ChatText;
|
||||
|
||||
if(result.indexOf(m) != (result.size() - 1)) {
|
||||
abc += "\n";
|
||||
}
|
||||
}
|
||||
|
||||
Log.i("CHUNKS", abc);
|
||||
|
||||
databaseHandler.addChatMessages(result);
|
||||
|
||||
listView.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
chatMessages.addAll(result);
|
||||
adapter.sort(DATE_COMPARATOR);
|
||||
adapter.notifyDataSetChanged();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public static final Comparator<ChatMessage> DATE_COMPARATOR = new Comparator<ChatMessage>() {
|
||||
@Override
|
||||
public int compare(ChatMessage lhs, ChatMessage rhs) {
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package beyondsoft.bewomitarbeiterapp;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import entities.ChatPerson;
|
||||
|
||||
/**
|
||||
@@ -35,10 +37,11 @@ public class ContactListItem {
|
||||
this.mIsEmployee = isEmployee;
|
||||
}
|
||||
|
||||
ContactListItem(String kontaktname, int personOid, boolean isTeam, String teamMemberOids, String teamMemberNames, int version, boolean isEmployee){
|
||||
ContactListItem(String kontaktname, int personOid, byte[] picture, boolean isTeam, String teamMemberOids, String teamMemberNames, int version, boolean isEmployee){
|
||||
this.mChatName = kontaktname;
|
||||
this.mPersonOid = personOid;
|
||||
this.mPicture = null;
|
||||
this.mPicture = picture;
|
||||
|
||||
this.isTeam = isTeam;
|
||||
this.teamMemberNames = teamMemberNames;
|
||||
this.teamMemberOids = teamMemberOids;
|
||||
|
||||
@@ -73,6 +73,20 @@ public class KontaktAdapter extends ArrayAdapter<ContactListItem> {
|
||||
|
||||
Bitmap i = BitmapFactory.decodeByteArray(imageAsByteArray, 0, imageAsByteArray.length);
|
||||
|
||||
if(i == null) {
|
||||
int bildId = R.drawable.mitarbeiter_avatar;
|
||||
|
||||
if(currentContact.isTeam) {
|
||||
bildId = R.drawable.mitarbeiter_team_avatar;
|
||||
} else if(!currentContact.getIsEmployee()) {
|
||||
bildId = R.drawable.klient_avatar;
|
||||
}
|
||||
|
||||
Bitmap bitmap = decodeSampledBitmapFromResource(inflater.getContext().getResources(), bildId, 100, 100);
|
||||
|
||||
imageView.setImageBitmap(ImageConverter.getRoundedCornerBitmap(bitmap, bitmap.getWidth() / 2));
|
||||
}
|
||||
|
||||
getPic = new Thread(new CircleBitmapCreator(i));
|
||||
getPic.start();
|
||||
} else {
|
||||
|
||||
@@ -52,6 +52,7 @@ import tcpConnection.SocketManager;
|
||||
import tcpConnection.UIHandler;
|
||||
import util.BeWoLog;
|
||||
import util.ChatMessageDeserializer;
|
||||
import util.ChatPersonDeserializer;
|
||||
import util.ConnectivityReceiver;
|
||||
import util.SecurityUtils;
|
||||
import util.Util;
|
||||
@@ -666,7 +667,6 @@ public class KontaktChatActivity extends ActionBarActivity implements Connectivi
|
||||
|
||||
Log.e(LOGTAG, "Der vom Server zurückgelieferte Wert ist NULL! (Laden der Kontakte)");
|
||||
|
||||
//TODO: wie im Chat
|
||||
try {
|
||||
ArrayList<PropertyInfo> propertyInfos = new ArrayList<>();
|
||||
|
||||
@@ -708,7 +708,10 @@ public class KontaktChatActivity extends ActionBarActivity implements Connectivi
|
||||
|
||||
isDownloadOfContacsInProgress = false;
|
||||
|
||||
Gson gson = new GsonBuilder().create();
|
||||
GsonBuilder builder = new GsonBuilder();
|
||||
builder.registerTypeAdapter(ChatPerson.class, new ChatPersonDeserializer());
|
||||
|
||||
Gson gson = builder.create();
|
||||
|
||||
Type listType = new TypeToken<ArrayList<ChatPerson>>(){}.getType();
|
||||
|
||||
@@ -723,7 +726,8 @@ public class KontaktChatActivity extends ActionBarActivity implements Connectivi
|
||||
}
|
||||
|
||||
for(ChatPerson cp : result) {
|
||||
ContactListItem contact = new ContactListItem(cp.Name, cp.Oid, cp.IsTeam, cp.TeamMemberOids, cp.TeamMemberNames, cp.Version, cp.IsEmployee);
|
||||
Log.i("KONTAKTE_VOM_SERVER", "(" + cp.Name + ") Größe des Bildes: " + (cp.ImageThumbnail != null ? "" + cp.ImageThumbnail.length : "Bild ist NULL"));
|
||||
ContactListItem contact = new ContactListItem(cp.Name, cp.Oid, cp.ImageThumbnail, cp.IsTeam, cp.TeamMemberOids, cp.TeamMemberNames, cp.Version, cp.IsEmployee);
|
||||
|
||||
ChatEntity cliEntity = new ChatEntity(cp.Oid, cp.IsTeam, cp.IsEmployee);
|
||||
|
||||
|
||||
@@ -22,7 +22,11 @@ import android.widget.EditText;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.android.volley.Request;
|
||||
import com.android.volley.RequestQueue;
|
||||
import com.android.volley.Response;
|
||||
import com.android.volley.VolleyError;
|
||||
import com.android.volley.toolbox.StringRequest;
|
||||
import com.android.volley.toolbox.Volley;
|
||||
import com.octo.android.robospice.SpiceManager;
|
||||
import com.octo.android.robospice.UncachedSpiceService;
|
||||
@@ -248,7 +252,7 @@ public class LoginActivity extends ActionBarActivity {
|
||||
showProgress(true);
|
||||
|
||||
RequestQueue queue = Volley.newRequestQueue(LoginActivity.this);
|
||||
String url = SoapCalls.TOKEN_CHECK_URL + token;
|
||||
String url = SoapCalls.VOUCHER_ADDRESS + token;
|
||||
|
||||
// StringRequest stringRequest = new StringRequest(Request.Method.GET, url, new Response.Listener<String>() {
|
||||
// @Override
|
||||
@@ -262,23 +266,26 @@ public class LoginActivity extends ActionBarActivity {
|
||||
//
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// Util.buildAlert(LoginActivity.this, response);
|
||||
|
||||
ArrayList<PropertyInfo> propertyInfos = new ArrayList<>();
|
||||
propertyInfos.add(SoapConnectionManager.BuildProperty("pTenant", tenant, String.class));
|
||||
propertyInfos.add(SoapConnectionManager.BuildProperty("pUsername", username, String.class));
|
||||
propertyInfos.add(SoapConnectionManager.BuildProperty("pPassword", password, String.class));
|
||||
ArrayList<PropertyInfo> propertyInfos = new ArrayList<>();
|
||||
propertyInfos.add(SoapConnectionManager.BuildProperty("pTenant", tenant, String.class));
|
||||
propertyInfos.add(SoapConnectionManager.BuildProperty("pUsername", username, String.class));
|
||||
propertyInfos.add(SoapConnectionManager.BuildProperty("pPassword", password, String.class));
|
||||
|
||||
JsonSoapPrimitiveRequest request = new JsonSoapPrimitiveRequest(SoapCalls.LOGIN_CALL, propertyInfos);
|
||||
spiceManager.execute(request, new JsonSoapPrimitiveRequestListener());
|
||||
JsonSoapPrimitiveRequest request = new JsonSoapPrimitiveRequest(SoapCalls.LOGIN_CALL, propertyInfos);
|
||||
spiceManager.execute(request, new JsonSoapPrimitiveRequestListener());
|
||||
// }
|
||||
// }, new Response.ErrorListener() {
|
||||
// @Override
|
||||
// public void onErrorResponse(VolleyError error) {
|
||||
// showProgress(false);
|
||||
//
|
||||
// Log.e("Error sending request", (error == null ? "error is null" : error.getMessage()));
|
||||
// }
|
||||
// });
|
||||
|
||||
//
|
||||
// queue.add(stringRequest);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,4 +11,14 @@ public class ChatPerson {
|
||||
public String TeamMemberOids;
|
||||
public int Version;
|
||||
public boolean IsEmployee;
|
||||
|
||||
public ChatPerson(int oid, String name, boolean isTeam, String teamMemberNames, String teamMemberOids, int version, boolean isEmployee) {
|
||||
Oid = oid;
|
||||
Name = name;
|
||||
IsTeam = isTeam;
|
||||
TeamMemberNames = teamMemberNames;
|
||||
TeamMemberOids = teamMemberOids;
|
||||
Version = version;
|
||||
IsEmployee = isEmployee;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package entities;
|
||||
|
||||
/**
|
||||
* Created by Lyndon Jetten on 21.11.2016.
|
||||
*/
|
||||
|
||||
public class ImageEntity {
|
||||
public int PersonOid;
|
||||
public byte[] Image;
|
||||
|
||||
public ImageEntity(int personOid, byte[] image) {
|
||||
PersonOid = personOid;
|
||||
Image = image;
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,7 @@ package soapConnection;
|
||||
*/
|
||||
public class SoapCalls {
|
||||
public static String GET_SERVER_ADDRESS_BY_TOKEN_CALL = "GetServerAddressByToken";
|
||||
public static String VOUCHER_ADDRESS = "https://mobile.bewoplaner.de/checkvoucher.php?Voucher=";
|
||||
public static String LOGIN_CALL = "Login";
|
||||
public static String GET_CONTACTS_FOR_PERSON = "GetContactsForPerson";
|
||||
|
||||
|
||||
@@ -54,8 +54,6 @@ public class ChatMessageDeserializer implements JsonDeserializer<ChatMessage> {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
ChatMessage result = new ChatMessage(senderPersonOid, recipientPersonOid, insTs, chatText, isDelivered, serverseitigeOid, isTeam, messageId);
|
||||
|
||||
return result;
|
||||
return new ChatMessage(senderPersonOid, recipientPersonOid, insTs, chatText, isDelivered, serverseitigeOid, isTeam, messageId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
package util;
|
||||
|
||||
import com.google.gson.JsonDeserializationContext;
|
||||
import com.google.gson.JsonDeserializer;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParseException;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
|
||||
import entities.ChatPerson;
|
||||
|
||||
/**
|
||||
* Created by Lyndon Jetten on 18.11.2016.
|
||||
*/
|
||||
|
||||
public class ChatPersonDeserializer implements JsonDeserializer<ChatPerson> {
|
||||
@Override
|
||||
public ChatPerson deserialize(JsonElement jsonElement, Type type, JsonDeserializationContext jsonDeserializationContext) throws JsonParseException {
|
||||
JsonObject json = (JsonObject) jsonElement;
|
||||
|
||||
int oid = Long.valueOf(json.get("Oid").getAsLong()).intValue();
|
||||
String name = json.get("Name").getAsString();
|
||||
boolean isTeam = json.get("IsTeam").getAsBoolean();
|
||||
|
||||
boolean isTeamMemberNamesNull = json.get("TeamMemberNames").isJsonNull();
|
||||
boolean isTeamMemberOidsNull = json.get("TeamMemberOids").isJsonNull();
|
||||
|
||||
String teamMemberNames = isTeamMemberNamesNull ? null : json.get("TeamMemberNames").getAsString(); // könnte NULL sein
|
||||
String teamMemberOids = isTeamMemberOidsNull ? null : json.get("TeamMemberOids").getAsString(); // könnte NULL sein
|
||||
int version = Long.valueOf(json.get("Version").getAsLong()).intValue();
|
||||
boolean isEmployee = json.get("IsEmployee").getAsBoolean();
|
||||
|
||||
// JsonArray originalValue = json.get("ImageThumbnail").getAsJsonArray();
|
||||
// String stringValue = originalValue.toString();
|
||||
// byte[] bytesValue = stringValue.getBytes();
|
||||
// byte[] image = null;//new byte[0];//isImageThumbnailNull ? new byte[0] : json.get("ImageThumbnail").getAsJsonArray().toString().getBytes();
|
||||
|
||||
// String[] test = stringValue.substring(1, stringValue.length() - 1).split(",");
|
||||
// byte[] abcdef = new byte[test.length];
|
||||
// for(int i = 0; len = test.length; i < len; i++) {
|
||||
//
|
||||
// }
|
||||
|
||||
|
||||
return new ChatPerson(oid, name, isTeam, teamMemberNames, teamMemberOids, version, isEmployee);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package util;
|
||||
|
||||
import com.google.gson.JsonDeserializationContext;
|
||||
import com.google.gson.JsonDeserializer;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParseException;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
|
||||
import entities.ImageEntity;
|
||||
|
||||
/**
|
||||
* Created by Lyndon Jetten on 21.11.2016.
|
||||
*/
|
||||
|
||||
public class ImageEntityDeserializer implements JsonDeserializer<ImageEntity> {
|
||||
@Override
|
||||
public ImageEntity deserialize(JsonElement jsonElement, Type type, JsonDeserializationContext context) throws JsonParseException {
|
||||
|
||||
JsonObject json = (JsonObject) jsonElement;
|
||||
|
||||
int oid = Long.valueOf(json.get("Oid").getAsLong()).intValue();
|
||||
String imgAsBase64 = json.get("").getAsString();
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user