Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,17 @@ android {
}
}

repositories {
google()
}

dependencies {
implementation 'com.wajahatkarim3.EasyFlipView:EasyFlipView:2.1.2'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:support-v4:28.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
Expand Down
6 changes: 6 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,19 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.csun_compt">

<uses-feature android:name="android.hardware.camera"
android:required="true" />

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".UserSubmissionPopUp" />
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand Down
34 changes: 32 additions & 2 deletions app/src/main/java/com/example/csun_compt/MainActivity.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,43 @@
package com.example.csun_compt;

import android.content.Intent;
import android.graphics.Bitmap;
import android.provider.MediaStore;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.Toast;

public class MainActivity extends AppCompatActivity {

private Button cameraButton;
private ImageView capturedImage;
private static final int Image_Capture_Code = 1;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
cameraButton =(Button)findViewById(R.id.cameraButton);
capturedImage = (ImageView) findViewById(R.id.meme_view);
cameraButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent cInt = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(cInt,Image_Capture_Code);
}
});
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == Image_Capture_Code) {
if (resultCode == RESULT_OK) {
Bitmap bp = (Bitmap) data.getExtras().get("data");
capturedImage.setImageBitmap(bp);
} else if (resultCode == RESULT_CANCELED) {
Toast.makeText(this, "Cancelled", Toast.LENGTH_LONG).show();
}
}
}
}
}
13 changes: 13 additions & 0 deletions app/src/main/java/com/example/csun_compt/UserSubmissionPopUp.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.example.csun_compt;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

public class UserSubmissionPopUp extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_user_submission_pop_up);
}
}
78 changes: 74 additions & 4 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,87 @@
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/relativeLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/black"
tools:context=".MainActivity">

<!--spacer for aesthetics-->
<Space
android:id="@+id/spacer"
android:layout_width="match_parent"
android:layout_height="100dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<!--this is the image view for the meme(gray right now just for visibility)-->
<ImageView
android:id="@+id/meme_view"
android:layout_width="290dp"
android:layout_height="290dp"
android:background="@color/gray"
app:layout_constraintHorizontal_bias="0.504"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/cameraButton" />

<!--this is the button that takes you to the previous meme image-->
<Button
android:id="@+id/back_button"
android:layout_width="145dp"
android:layout_height="55dp"
android:layout_marginTop="20dp"
android:text="BACK"
app:layout_constraintLeft_toLeftOf="@+id/description_text_view"
app:layout_constraintStart_toStartOf="@+id/description_text_view"
app:layout_constraintTop_toBottomOf="@+id/description_text_view" />


<!--this is the take a picture button-->
<Button
android:id="@+id/cameraButton"
android:layout_width="82dp"
android:layout_height="65dp"
android:text="CAMERA"
tools:layout_editor_absoluteX="26dp"
tools:layout_editor_absoluteY="0dp" />
<!--this is the button that brings you to the next meme image-->
<Button
android:id="@+id/next_button"
android:layout_width="145dp"
android:layout_height="55dp"
android:layout_marginBottom="12dp"
android:text="NEXT"
app:layout_constraintBottom_toTopOf="@+id/more_button"
app:layout_constraintLeft_toRightOf="@+id/back_button"
app:layout_constraintStart_toEndOf="@+id/back_button" />

<!--this is an editable text view for user submissions-->
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
android:id="@+id/description_text_view"
android:layout_width="290dp"
android:layout_height="100dp"
android:scrollbars="vertical"
android:text="Yo! I'm trying to see if its possible to scroll on this in the emulator."
android:textColor="@color/white"
android:textSize="14pt"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/meme_view" />

<!--this is the button that brings up the user submission pop up-->
<Button
android:id="@+id/more_button"
android:layout_width="145dp"
android:layout_height="55dp"
android:layout_marginTop="12dp"
android:layout_marginBottom="8dp"
android:text="More"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toBottomOf="@+id/back_button"
app:layout_constraintVertical_bias="0.0" />

</android.support.constraint.ConstraintLayout>
65 changes: 65 additions & 0 deletions app/src/main/res/layout/activity_user_submission_pop_up.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/relativeLayout2"
android:layout_width="350dp"
android:layout_height="475dp"
android:layout_gravity="center"
android:background="@color/gray"
android:orientation="vertical"
android:padding="5dp">

<!--button to close popup(or show the main activity page)-->
<Button
android:id="@+id/txtclose"
android:layout_width="30dp"
android:layout_height="30dp"
android:background="@color/black"
android:text="X"
android:textColor="@color/white"
android:textStyle="bold"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<!--text view of description of what user should do on this page-->
<TextView
android:id="@+id/instr_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="5dp"
android:text="Please include a description of the image, any text in the image, and a little info about why it's funny."
android:textAlignment="center"
android:textColor="@color/white"
android:textSize="12pt"
android:textStyle="bold"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/txtclose" />

<!--editable text box for submissions-->
<EditText
android:id="@+id/user_input_box"
android:layout_width="300dp"
android:layout_height="150dp"

android:layout_marginTop="12dp"
android:background="@color/white"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/instr_text" />

<!--button to submit and save the user submission-->
<Button
android:id="@+id/submit_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="25dp"
android:background="@color/black"
android:text="Submit"
android:textColor="@color/white"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/user_input_box" />

</android.support.constraint.ConstraintLayout>
5 changes: 5 additions & 0 deletions app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,9 @@
<color name="colorPrimary">#008577</color>
<color name="colorPrimaryDark">#00574B</color>
<color name="colorAccent">#D81B60</color>
<color name="purple">#4B244A</color>
<color name="black">#000000</color>
<color name="white">#FFFFFF</color>
<color name="gray">#808080</color>

</resources>
2 changes: 2 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<resources>
<string name="app_name">CSUN-COMPT</string>

<string name="meme_description">Description: This is just a really long string that really has no relevance to anything whatsoever but I need it to be long enough to try a scroll view So Im just gonna keep adding random words to try it out. k byeeeeeeee</string>
</resources>