Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Christof Wolke
BIDL
Commits
c4e93cac
Commit
c4e93cac
authored
Sep 01, 2016
by
Christof Wolke
Browse files
CommentListadapter + View
parent
e6b9f79e
Changes
18
Hide whitespace changes
Inline
Side-by-side
BIDL/BIDL/app/src/main/java/classes/Event.java
View file @
c4e93cac
...
...
@@ -5,6 +5,7 @@ import com.bluelinelabs.logansquare.annotation.JsonObject;
import
java.io.Serializable
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
co.uk.rushorm.core.RushObject
;
...
...
@@ -22,12 +23,12 @@ public class Event extends RushObject implements Serializable {
private
String
name
;
@JsonField
(
name
=
"apps"
)
private
ArrayList
<
String
>
apps
;
private
HashMap
<
String
,
String
>
apps
;
public
Event
()
{
}
public
Event
(
int
eventId
,
String
name
,
ArrayList
<
String
>
apps
)
{
public
Event
(
int
eventId
,
String
name
,
HashMap
<
String
,
String
>
apps
)
{
this
.
eventId
=
eventId
;
this
.
name
=
name
;
this
.
apps
=
apps
;
...
...
@@ -50,11 +51,11 @@ public class Event extends RushObject implements Serializable {
this
.
name
=
name
;
}
public
ArrayList
<
String
>
getApps
()
{
public
HashMap
<
String
,
String
>
getApps
()
{
return
apps
;
}
public
void
setApps
(
ArrayList
<
String
>
apps
)
{
public
void
setApps
(
HashMap
<
String
,
String
>
apps
)
{
this
.
apps
=
apps
;
}
...
...
BIDL/BIDL/app/src/main/java/classes/MyList.java
0 → 100644
View file @
c4e93cac
package
classes
;
import
java.io.Serializable
;
/**
* Superklasse für alle Listen Objekte
* Created by Christof on 01.09.2016.
*/
public
class
MyList
implements
Serializable
{
}
BIDL/BIDL/app/src/main/java/classes/apps/AppContainer.java
View file @
c4e93cac
...
...
@@ -5,6 +5,9 @@ import com.bluelinelabs.logansquare.annotation.JsonObject;
import
java.io.Serializable
;
import
classes.apps.feedback.Feedback
;
import
classes.apps.forum.Forum
;
import
classes.apps.materials.Materials
;
import
co.uk.rushorm.core.RushObject
;
/**
...
...
BIDL/BIDL/app/src/main/java/classes/apps/Feedback.java
→
BIDL/BIDL/app/src/main/java/classes/apps/Feedback
/Feedback
.java
View file @
c4e93cac
package
classes.apps
;
package
classes.apps
.feedback
;
import
com.bluelinelabs.logansquare.annotation.JsonField
;
import
com.bluelinelabs.logansquare.annotation.JsonObject
;
...
...
BIDL/BIDL/app/src/main/java/classes/apps/Comment.java
→
BIDL/BIDL/app/src/main/java/classes/apps/
Forum/
Comment.java
View file @
c4e93cac
package
classes.apps
;
package
classes.apps
.forum
;
import
com.bluelinelabs.logansquare.annotation.JsonField
;
import
com.bluelinelabs.logansquare.annotation.JsonObject
;
import
java.io.Serializable
;
import
java.util.Date
;
import
co.uk.rushorm.core.RushObject
;
import
co.uk.rushorm.core.annotations.RushList
;
/**
* Created by Christof on 23.08.2016.
...
...
BIDL/BIDL/app/src/main/java/classes/apps/Forum/CommentList.java
0 → 100644
View file @
c4e93cac
package
classes.apps.forum
;
import
com.bluelinelabs.logansquare.annotation.JsonField
;
import
com.bluelinelabs.logansquare.annotation.JsonObject
;
import
java.io.Serializable
;
import
java.util.ArrayList
;
import
classes.MyList
;
/**
*
* Created by Christof on 01.09.2016.
*/
@JsonObject
public
class
CommentList
extends
MyList
implements
Serializable
{
@JsonField
private
ArrayList
<
Comment
>
commentList
;
public
CommentList
(){
}
public
CommentList
(
ArrayList
<
Comment
>
commentList
)
{
this
.
commentList
=
commentList
;
}
public
ArrayList
<
Comment
>
getCommentList
()
{
return
commentList
;
}
public
void
setCommentList
(
ArrayList
<
Comment
>
commentList
)
{
this
.
commentList
=
commentList
;
}
@Override
public
String
toString
()
{
return
"CommentList{"
+
"commentList="
+
commentList
+
'}'
;
}
}
BIDL/BIDL/app/src/main/java/classes/apps/Forum.java
→
BIDL/BIDL/app/src/main/java/classes/apps/Forum
/Forum
.java
View file @
c4e93cac
package
classes.apps
;
package
classes.apps
.forum
;
import
com.bluelinelabs.logansquare.annotation.JsonField
;
import
com.bluelinelabs.logansquare.annotation.JsonObject
;
...
...
@@ -18,14 +18,15 @@ public class Forum extends RushObject implements Serializable {
@JsonField
(
name
=
"id"
)
private
int
forumId
;
@RushList
(
classType
=
Forum
.
Comment
.
class
)
@JsonField
(
name
=
"comments"
)
private
ArrayList
<
Comment
>
comments
;
private
ArrayList
<
Forum
.
Comment
>
comments
;
public
Forum
(){
}
public
Forum
(
int
id
,
ArrayList
<
Comment
>
comments
)
{
public
Forum
(
int
id
,
ArrayList
<
Forum
.
Comment
>
comments
)
{
this
.
forumId
=
id
;
this
.
comments
=
comments
;
}
...
...
@@ -38,11 +39,11 @@ public class Forum extends RushObject implements Serializable {
this
.
forumId
=
forumId
;
}
public
ArrayList
<
Comment
>
getComments
()
{
public
ArrayList
<
Forum
.
Comment
>
getComments
()
{
return
comments
;
}
public
void
setComments
(
ArrayList
<
Comment
>
comments
)
{
public
void
setComments
(
ArrayList
<
Forum
.
Comment
>
comments
)
{
this
.
comments
=
comments
;
}
...
...
BIDL/BIDL/app/src/main/java/classes/apps/Materials.java
→
BIDL/BIDL/app/src/main/java/classes/apps/
materials/
Materials.java
View file @
c4e93cac
package
classes.apps
;
package
classes.apps
.materials
;
import
com.bluelinelabs.logansquare.annotation.JsonField
;
import
com.bluelinelabs.logansquare.annotation.JsonObject
;
...
...
BIDL/BIDL/app/src/main/java/de/uni_oldenburg/bidl/BaseActivity.java
View file @
c4e93cac
...
...
@@ -26,7 +26,7 @@ public class BaseActivity extends AppCompatActivity implements NavigationView.On
protected
void
setMenu
()
{
Toolbar
toolbar
=
(
Toolbar
)
findViewById
(
R
.
id
.
toolbar
);
setSupportActionBar
(
toolbar
);
//
setSupportActionBar(toolbar);
DrawerLayout
drawer
=
(
DrawerLayout
)
findViewById
(
R
.
id
.
drawer_layout
);
ActionBarDrawerToggle
toggle
=
new
ActionBarDrawerToggle
(
...
...
BIDL/BIDL/app/src/main/java/de/uni_oldenburg/bidl/home_view/MainActivity.java
View file @
c4e93cac
...
...
@@ -18,7 +18,10 @@ import com.estimote.sdk.Region;
import
com.estimote.sdk.SystemRequirementsChecker
;
import
java.util.ArrayList
;
import
java.util.Collection
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.UUID
;
import
classes.Event
;
...
...
@@ -54,6 +57,7 @@ public class MainActivity extends BaseActivity {
private
ArrayList
<
String
>
apps
=
new
ArrayList
<>();
private
ArrayAdapter
<
String
>
adapter
;
private
Event
event
;
private
HashMap
<
String
,
String
>
map
;
...
...
@@ -103,10 +107,12 @@ public class MainActivity extends BaseActivity {
public
void
onItemClick
(
AdapterView
<?>
adapterView
,
View
view
,
int
position
,
long
id
)
{
String
appName
=
(
String
)
adapterView
.
getItemAtPosition
(
position
);
Class
<?>
c
=
null
;
String
app
=
getClassnameFromHashmap
(
appName
);
Class
<?>
c
=
null
;
try
{
c
=
Class
.
forName
(
appPackage
+
app
Name
+
"Activity"
);
c
=
Class
.
forName
(
appPackage
+
app
+
"Activity"
);
}
catch
(
ClassNotFoundException
e
)
{
e
.
printStackTrace
();
}
...
...
@@ -115,6 +121,17 @@ public class MainActivity extends BaseActivity {
}
private
String
getClassnameFromHashmap
(
String
appName
)
{
for
(
Map
.
Entry
<
String
,
String
>
entry
:
map
.
entrySet
()){
String
key
=
entry
.
getKey
();
String
value
=
entry
.
getValue
();
if
(
value
.
equals
(
appName
)){
return
key
;
}
}
return
null
;
}
});
}
...
...
@@ -161,7 +178,9 @@ public class MainActivity extends BaseActivity {
@Override
public
void
run
()
{
setTitle
(
event
.
getName
());
updateData
(
event
.
getApps
());
map
=
event
.
getApps
();
Collection
<
String
>
appnames
=
map
.
values
();
updateData
(
appnames
);
setEvent
(
event
);
}
});
...
...
@@ -176,7 +195,7 @@ public class MainActivity extends BaseActivity {
}
private
void
updateData
(
ArrayList
<
String
>
apps
)
{
private
void
updateData
(
Collection
<
String
>
apps
)
{
progress
.
dismiss
();
adapter
.
clear
();
if
(
apps
!=
null
){
...
...
BIDL/BIDL/app/src/main/java/de/uni_oldenburg/bidl/listfragment/CommentListAdapter.java
0 → 100644
View file @
c4e93cac
package
de.uni_oldenburg.bidl.listfragment
;
/**
* Created by Christof on 01.09.2016.
*/
public
class
CommentListAdapter
{
}
BIDL/BIDL/app/src/main/java/de/uni_oldenburg/bidl/listfragment/ListAdapter.java
0 → 100644
View file @
c4e93cac
package
de.uni_oldenburg.bidl.listfragment
;
import
android.widget.BaseAdapter
;
import
classes.MyList
;
/**
* Created by Christof on 01.09.2016.
*/
public
abstract
class
ListAdapter
extends
BaseAdapter
{
abstract
void
setList
(
MyList
list
);
}
BIDL/BIDL/app/src/main/java/de/uni_oldenburg/bidl/member_view/ForumActivity.java
View file @
c4e93cac
...
...
@@ -2,18 +2,15 @@ package de.uni_oldenburg.bidl.member_view;
import
android.support.v7.app.AppCompatActivity
;
import
android.os.Bundle
;
import
android.util.Log
;
import
classes.Event
;
import
classes.apps.Comment
;
import
classes.apps.Forum
;
import
classes.apps.forum.Forum
;
import
de.uni_oldenburg.bidl.R
;
import
de.uni_oldenburg.bidl.home_view.MainActivity
;
import
services.db.DBHelper
;
import
services.servercommunication.NetworkService
;
public
class
ForumActivity
extends
AppCompatActivity
{
public
class
ForumActivity
extends
AppCompatActivity
{
/** Tag for Logging **/
private
static
final
String
TAG
=
ForumActivity
.
class
.
getSimpleName
();
...
...
@@ -27,22 +24,38 @@ public class ForumActivity extends AppCompatActivity {
setTitle
(
getIntent
().
getStringExtra
(
"appName"
));
Event
event
=
DBHelper
.
getEvent
();
getForumObjectFromServer
(
event
.
getEventId
());
}
private
void
getForumObjectFromServer
(
int
eventId
)
{
NetworkService
.
forum
(
eventId
,
new
NetworkService
.
RequestForumHandler
()
{
@Override
public
void
done
(
final
Forum
forum
)
{
setForum
(
forum
);
Comment
comment
=
forum
.
getComments
().
get
(
0
);
Log
.
d
(
TAG
,
"FORUMACTIVITY: "
+
comment
.
getText
());
public
void
done
(
Forum
forum
)
{
if
(
forum
!=
null
){
setForum
(
forum
);
ForumActivity
.
this
.
runOnUiThread
(
new
Runnable
()
{
@Override
public
void
run
()
{
initGui
();
}
});
}
}
});
}
public
void
initGui
()
{
try
{
if
(
forum
.
getComments
()
!=
null
){
}
}
catch
(
NullPointerException
e
){
e
.
printStackTrace
();
}
}
public
void
setForum
(
Forum
forum
)
{
this
.
forum
=
forum
;
}
...
...
BIDL/BIDL/app/src/main/java/services/servercommunication/NetworkService.java
View file @
c4e93cac
package
services.servercommunication
;
import
android.util.Log
;
import
com.bluelinelabs.logansquare.LoganSquare
;
import
com.squareup.okhttp.Call
;
import
com.squareup.okhttp.Callback
;
...
...
@@ -12,15 +10,12 @@ import com.squareup.okhttp.RequestBody;
import
com.squareup.okhttp.Response
;
import
java.io.IOException
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.concurrent.TimeUnit
;
import
classes.Event
;
import
classes.StatusResponse
;
import
classes.User
;
import
classes.apps.Comment
;
import
classes.apps.Forum
;
import
classes.apps.forum.Forum
;
/**
* Helfer Klasse, die häufig verwendete I/O Operationen im Netzwerk und der Datenbank erleichtert
...
...
BIDL/BIDL/app/src/main/res/layout/comment_item.xml
0 → 100644
View file @
c4e93cac
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:orientation=
"horizontal"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<ScrollView
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:id=
"@+id/username"
android:layout_margin=
"10dp"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:id=
"@+id/message"
android:layout_margin=
"10dp"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:id=
"@+id/time"
android:layout_margin=
"10dp"
/>
</ScrollView>
</LinearLayout>
\ No newline at end of file
BIDL/BIDL/app/src/main/res/layout/content_main.xml
View file @
c4e93cac
...
...
@@ -33,7 +33,7 @@
android:stretchMode=
"columnWidth"
android:id=
"@+id/mainActivityGrid"
android:numColumns=
"2"
android:focusable=
"true"
/>
android:focusable=
"true"
/>
...
...
BIDL/BIDL/app/src/main/res/layout/grid_item.xml
View file @
c4e93cac
...
...
@@ -14,6 +14,7 @@
android:layout_margin=
"10dp"
android:padding=
"20dp"
android:elevation=
"2dp"
android:singleLine=
"false"
/>
android:singleLine=
"false"
android:minLines=
"3"
/>
</LinearLayout>
\ No newline at end of file
BIDL/BIDL/app/src/main/res/values/styles.xml
View file @
c4e93cac
...
...
@@ -8,23 +8,6 @@
<item
name=
"colorAccent"
>
@color/colorAccent
</item>
</style>
<style
name=
"FullscreenTheme"
parent=
"AppTheme"
>
<item
name=
"android:actionBarStyle"
>
@style/FullscreenActionBarStyle
</item>
<item
name=
"android:windowActionBarOverlay"
>
true
</item>
<item
name=
"android:windowBackground"
>
@null
</item>
<item
name=
"metaButtonBarStyle"
>
?android:attr/buttonBarStyle
</item>
<item
name=
"metaButtonBarButtonStyle"
>
?android:attr/buttonBarButtonStyle
</item>
</style>
<style
name=
"FullscreenActionBarStyle"
parent=
"Widget.AppCompat.ActionBar"
>
<item
name=
"android:background"
>
@color/black_overlay
</item>
</style>
<style
name=
"AppTheme.NoActionBar"
>
<item
name=
"windowActionBar"
>
false
</item>
<item
name=
"windowNoTitle"
>
true
</item>
</style>
<style
name=
"AppTheme.AppBarOverlay"
parent=
"ThemeOverlay.AppCompat.Dark.ActionBar"
/>
<style
name=
"AppTheme.PopupOverlay"
parent=
"ThemeOverlay.AppCompat.Light"
/>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment