Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

edit profile #42

Open
wants to merge 4 commits into
base: Like-incorrect-photo-bug-fix
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
38 changes: 24 additions & 14 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 25
buildToolsVersion "25.0.0"
compileSdkVersion 27
defaultConfig {
applicationId "tabian.com.instagramclone2"
minSdkVersion 18

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure having minSdkVersion 21?
As I know you cannot use lambdas or other cool features using minSdkVerison 18

targetSdkVersion 25
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
Expand All @@ -20,35 +19,46 @@ android {
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:appcompat-v7:27.0.2'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'

//Design library for Coordinator Layout and Toolbars
compile 'com.android.support:design:25.3.1'

compile 'com.android.support:design:27.0.2'
//ExifInterface support
compile 'com.android.support:exifinterface:27.0.2'
//design library for Coordinator Layout
compile 'com.android.support:design:27.0.2'
//Exo Player
compile 'com.google.android.exoplayer:exoplayer:2.6.0'
//cardview
compile 'com.android.support:cardview-v7:27.0.2'
//recyclerview
compile 'com.android.support:recyclerview-v7:27.0.2'
//BottomNavigationViewEx library
compile 'com.github.ittianyu:BottomNavigationViewEx:1.1.9'

//Circle ImageView
compile 'de.hdodenhof:circleimageview:2.1.0'

//elastic header
compile 'com.github.eschao:android-ElasticListView:v1.0'
//material dialogs
implementation 'com.afollestad.material-dialogs:core:0.9.6.0'
//glide
implementation 'com.github.bumptech.glide:glide:4.4.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.4.0'
implementation files('libs/aspectjrt-1.7.3 (1).jar')
//Universal image loader
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'

//firebase authentication
compile 'com.google.firebase:firebase-auth:10.2.6'

//firebase database
compile 'com.google.firebase:firebase-database:10.2.6'

//firebase storage
compile 'com.google.firebase:firebase-storage:10.2.6'

compile files('libs/aspectjrt-1.7.3 (1).jar')
}

//Firebase
Expand Down
Binary file added app/libs/aspectjrt-1.7.3 (1).jar
Binary file not shown.
Binary file added app/libs/isoparser-1.0.6.jar
Binary file not shown.
49 changes: 39 additions & 10 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,14 @@

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.CAMERA"/>
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />
<uses-permission android:name="android.permission.FLASHLIGHT"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />

<application
android:allowBackup="true"
Expand All @@ -14,23 +20,46 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name="tabian.com.instagramclone2.Home.HomeActivity">
<activity
android:name=".Home.HomeActivity"
android:screenOrientation="portrait"
android:launchMode="singleInstance">

</activity>
<activity android:name=".Likes.LikesActivity"
android:launchMode="singleInstance"/>
<activity android:name=".Profile.ProfileActivity"
android:launchMode="singleInstance"/>
<activity android:name=".Share.ShareActivity"
android:launchMode="singleInstance"/>
<activity android:name=".Share.NextActivity"
android:launchMode="singleInstance"/>
<activity android:name=".Login.LoginActivity"
android:launchMode="singleInstance">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>

<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity android:name="tabian.com.instagramclone2.Likes.LikesActivity"></activity>
<activity android:name="tabian.com.instagramclone2.Profile.ProfileActivity"></activity>
<activity android:name="tabian.com.instagramclone2.Search.SearchActivity"
android:windowSoftInputMode="adjustNothing">
<activity android:name=".Profile.AccountSettingsActivity"
android:launchMode="singleInstance"/>
<activity android:name=".Login.RegisterActivity"
android:launchMode="singleInstance"/>
<activity android:name=".opengl.OpenGLES10Activity"
android:launchMode="singleInstance"
android:screenOrientation="portrait"/>
<activity android:name=".opengl.NewStoryActivity"
android:launchMode="singleInstance"
android:screenOrientation="portrait"/>
<activity
android:name=".Search.SearchActivity"
android:windowSoftInputMode="adjustNothing"
android:launchMode="singleInstance">

</activity>
<activity android:name="tabian.com.instagramclone2.Share.ShareActivity"></activity>
<activity android:name="tabian.com.instagramclone2.Profile.AccountSettingsActivity"></activity>
<activity android:name="tabian.com.instagramclone2.Login.RegisterActivity"></activity>
<activity android:name="tabian.com.instagramclone2.Login.LoginActivity"></activity>
<activity android:name=".Share.NextActivity"/>
<activity android:name=".materialcamera.CaptureActivity" android:screenOrientation="portrait"/>
<activity android:name=".materialcamera.CaptureActivity2" android:screenOrientation="portrait"/>
</application>

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,17 @@
import tabian.com.instagramclone2.Login.LoginActivity;
import tabian.com.instagramclone2.R;
import tabian.com.instagramclone2.Utils.BottomNavigationViewHelper;
import tabian.com.instagramclone2.Utils.MainfeedListAdapter;
import tabian.com.instagramclone2.Utils.FirebaseMethods;
import tabian.com.instagramclone2.Utils.MainFeedListAdapter;
import tabian.com.instagramclone2.Utils.SectionsPagerAdapter;
import tabian.com.instagramclone2.Utils.UniversalImageLoader;
import tabian.com.instagramclone2.Utils.ViewCommentsFragment;
import tabian.com.instagramclone2.models.Photo;
import tabian.com.instagramclone2.models.UserAccountSettings;
import tabian.com.instagramclone2.opengl.AddToStoryDialog;
import tabian.com.instagramclone2.opengl.NewStoryActivity;

public class HomeActivity extends AppCompatActivity implements
MainfeedListAdapter.OnLoadMoreItemsListener{
MainFeedListAdapter.OnLoadMoreItemsListener{

@Override
public void onLoadMoreItems() {
Expand All @@ -47,6 +49,9 @@ public void onLoadMoreItems() {
private static final String TAG = "HomeActivity";
private static final int ACTIVITY_NUM = 0;
private static final int HOME_FRAGMENT = 1;
private static final int RESULT_ADD_NEW_STORY = 7891;
private final static int CAMERA_RQ = 6969;
private static final int REQUEST_ADD_NEW_STORY = 8719;

private Context mContext = HomeActivity.this;

Expand Down Expand Up @@ -76,6 +81,16 @@ protected void onCreate(Bundle savedInstanceState) {

}

public void openNewStoryActivity(){
Intent intent = new Intent(this, NewStoryActivity.class);
startActivityForResult(intent, REQUEST_ADD_NEW_STORY);
}

public void showAddToStoryDialog(){
Log.d(TAG, "showAddToStoryDialog: showing add to story dialog.");
AddToStoryDialog dialog = new AddToStoryDialog();
dialog.show(getFragmentManager(), getString(R.string.dialog_add_to_story));
}


public void onCommentThreadSelected(Photo photo, String callingActivity){
Expand Down Expand Up @@ -116,6 +131,36 @@ public void onBackPressed() {
}


@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
Log.d(TAG, "onActivityResult: incoming result.");
// Received recording or error from MaterialCamera

if (requestCode == REQUEST_ADD_NEW_STORY) {
Log.d(TAG, "onActivityResult: incoming new story.");
if (resultCode == RESULT_ADD_NEW_STORY) {
Log.d(TAG, "onActivityResult: got the new story.");
Log.d(TAG, "onActivityResult: data type: " + data.getType());

final HomeFragment fragment = (HomeFragment) getSupportFragmentManager().findFragmentByTag("android:switcher:" + R.id.viewpager_container + ":" + 1);
if (fragment != null) {

FirebaseMethods firebaseMethods = new FirebaseMethods(this);
firebaseMethods.uploadNewStory(data, fragment);

}
else{
Log.d(TAG, "onActivityResult: could not communicate with home fragment.");
}



}
}
}


private void initImageLoader(){
UniversalImageLoader universalImageLoader = new UniversalImageLoader(mContext);
ImageLoader.getInstance().init(universalImageLoader.getConfig());
Expand Down
Loading