-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
488a2d0
commit 641d28d
Showing
17 changed files
with
974 additions
and
39 deletions.
There are no files selected for viewing
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
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
43 changes: 43 additions & 0 deletions
43
app/src/main/java/com/example/platform/activities/CommunitiesActivity_ByGenre.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package com.example.platform.activities; | ||
|
||
import androidx.appcompat.app.AppCompatActivity; | ||
|
||
import android.os.Bundle; | ||
import android.widget.RelativeLayout; | ||
|
||
import com.example.platform.R; | ||
|
||
public class CommunitiesActivity_ByGenre extends AppCompatActivity { | ||
|
||
public static final String TAG = "CommunitiesActivity_ByGenre"; | ||
RelativeLayout rlAction, rlAdventure, rlAnimation, rlComedy, rlCrime, rlDocumentary, rlDrama, rlFamily, rlFantasy, rlHistory, rlHorror, rlMusic, rlReality, rlRomance, rlScienceFiction, rlSoap, rlTalk, rlThriller, rlWar, rlWestern; | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_communities_by_genre); | ||
|
||
rlAction = findViewById(R.id.rlAction_Genre); | ||
rlAdventure = findViewById(R.id.rlAdventure_Genre); | ||
rlAnimation = findViewById(R.id.rlAnimation_Genre); | ||
rlComedy = findViewById(R.id.rlComedy_Genre); | ||
rlCrime = findViewById(R.id.rlCrime_Genre); | ||
rlDocumentary = findViewById(R.id.rlDocumentary_Genre); | ||
rlDrama = findViewById(R.id.rlDrama_Genre); | ||
rlFamily = findViewById(R.id.rlFamily_Genre); | ||
rlFantasy = findViewById(R.id.rlFantasy_Genre); | ||
rlHistory = findViewById(R.id.rlHistory_Genre); | ||
rlHorror = findViewById(R.id.rlHorror_Genre); | ||
rlMusic = findViewById(R.id.rlMusic_Genre); | ||
rlReality = findViewById(R.id.rlReality_Genre); | ||
rlRomance = findViewById(R.id.rlRomance_Genre); | ||
rlScienceFiction = findViewById(R.id.rlScienceFiction_Genre); | ||
rlSoap = findViewById(R.id.rlSoap_Genre); | ||
rlTalk = findViewById(R.id.rlTalk_Genre); | ||
rlThriller = findViewById(R.id.rlThriller_Genre); | ||
rlWar = findViewById(R.id.rlWar_Genre); | ||
rlWestern = findViewById(R.id.rlWestern_Genre); | ||
|
||
//todo | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
app/src/main/java/com/example/platform/activities/CommunitiesActivity_Display.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.example.platform.activities; | ||
|
||
import android.os.Bundle; | ||
|
||
import androidx.appcompat.app.AppCompatActivity; | ||
|
||
import com.example.platform.R; | ||
|
||
public class CommunitiesActivity_Display extends AppCompatActivity { | ||
|
||
public static final String TAG = "CommunitiesActivity_Display"; | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_communities_display); | ||
} | ||
} |
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
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
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
112 changes: 112 additions & 0 deletions
112
app/src/main/java/com/example/platform/models/Community.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
package com.example.platform.models; | ||
|
||
import com.parse.ParseClassName; | ||
import com.parse.ParseObject; | ||
|
||
import org.json.JSONArray; | ||
import org.json.JSONException; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
@ParseClassName("Community") | ||
public class Community extends ParseObject { | ||
|
||
public static final String TAG = "Community"; | ||
public static final String KEY_NAME = "name"; | ||
public static final String KEY_DESCRIPTION = "description"; | ||
public static final String KEY_CREATOR = "creator"; | ||
public static final String KEY_MEMBERS = "members"; | ||
public static final String KEY_GENRES = "genres"; | ||
public static final String KEY_KEYWORDS = "keywords"; | ||
|
||
public String name; | ||
public String description; | ||
public String creator; | ||
public List<String> members; | ||
public List<String> genres; | ||
public List<String> keywords; | ||
|
||
// Default, empty constructor | ||
public Community() {} | ||
|
||
public void setName(String name) { | ||
put(Community.KEY_NAME, name); | ||
} | ||
|
||
public String getName() { | ||
return getString(Community.KEY_NAME); | ||
} | ||
|
||
public void setDescription(String description) { | ||
put(Community.KEY_DESCRIPTION, description); | ||
} | ||
|
||
public String getDescription() { | ||
return getString(Community.KEY_DESCRIPTION); | ||
} | ||
|
||
public void setCreator(String creator) { | ||
put(Community.KEY_CREATOR, creator); | ||
} | ||
|
||
public String getCreator() { | ||
return getString(Community.KEY_CREATOR); | ||
} | ||
|
||
public void setMembers(List<String> members) { | ||
put(Community.KEY_MEMBERS, members); | ||
} | ||
|
||
public List<String> getMembers() throws JSONException { | ||
JSONArray jsonArray = getJSONArray(Community.KEY_MEMBERS); | ||
List<String> members = new ArrayList<>(); | ||
|
||
if (jsonArray == null) { | ||
return members; | ||
} else { | ||
for (int i = 0; i < jsonArray.length(); i++) { | ||
members.add(jsonArray.getString(i)); | ||
} | ||
return members; | ||
} | ||
} | ||
|
||
public void setGenres(List<String> genres) { | ||
put(Community.KEY_GENRES, genres); | ||
this.genres = genres; | ||
} | ||
|
||
public List<String> getGenres() throws JSONException { | ||
JSONArray jsonArray = getJSONArray(Community.KEY_GENRES); | ||
List<String> genres = new ArrayList<>(); | ||
|
||
if (jsonArray == null) { | ||
return genres; | ||
} else { | ||
for (int i = 0; i < jsonArray.length(); i++) { | ||
genres.add(jsonArray.getString(i)); | ||
} | ||
return genres; | ||
} | ||
} | ||
|
||
public void setKeywords(List<String> keywords) { | ||
put(Community.KEY_KEYWORDS, keywords); | ||
this.keywords = keywords; | ||
} | ||
|
||
public List<String> getKeywords() throws JSONException { | ||
JSONArray jsonArray = getJSONArray(Community.KEY_GENRES); | ||
List<String> keywords = new ArrayList<>(); | ||
|
||
if (jsonArray == null) { | ||
return keywords; | ||
} else { | ||
for (int i = 0; i < jsonArray.length(); i++) { | ||
keywords.add(jsonArray.getString(i)); | ||
} | ||
return keywords; | ||
} | ||
} | ||
} |
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
Oops, something went wrong.