Skip to content

Commit

Permalink
shpark0308 Final State
Browse files Browse the repository at this point in the history
  • Loading branch information
shpark0308 committed Mar 12, 2021
1 parent d7749fd commit f3600c9
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 3 deletions.
2 changes: 1 addition & 1 deletion AmongEarth/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
<activity android:name="com.example.amongearth.record.LoadingActivity"/>
<activity android:name="com.example.amongearth.record.YoloActivity"/>
<activity android:name="com.example.amongearth.record.PopupActivity"
android:theme="@style/popupTheme" android:screenOrientation="portrait"/> <!-- popup style-->
android:theme="@style/popupTheme" android:screenOrientation="unspecified"/> <!-- popup style-->
<activity android:name="com.example.amongearth.mypage.MyStatsActivity" />
<activity android:name=".mypage.NoStatsActivity"/>
<activity android:name="com.example.amongearth.mypage.MyRecordActivity" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ public void onDataChange(@NonNull DataSnapshot snapshot) {
heartflag=0;
}

if (Integer.parseInt(data.child("visibility").getValue()+"")==1){
if (data.child("visibility").getValue()!=null && (Integer.parseInt(data.child("visibility").getValue()+"")==1)){
ArrayList<String> arr = new ArrayList<>(Arrays.asList(data.child("nickname").getValue() + "",data.getKey(),
data.child("content").getValue() + "", (data.child("likes").getChildrenCount()-1) + "",
data.child("upload_file").getValue()+"", userinfo.get(dataSnapshot.getKey()+"")+"", dataSnapshot.getKey(), Integer.toString(heartflag))); // 모두 String으로 받아옴
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,10 @@ public void onItemClick(AdapterView<?> parent, View view, int position, long id)
if (zero_waste_list.get(position).getHeartflag().equals("0")){
Log.d("이 Log코드는 지우지 마세요","");
updatechild.put(userId, userId);
databaseReference.child("challenge_board").child(zero_waste_list.get(position).getUserid()+"").child(zero_waste_list.get(position).getDate2()).child("likes").updateChildren(updatechild);
String s = zero_waste_list.get(position).getDate2().substring(0,4)+zero_waste_list.get(position).getDate2().substring(5,7)+zero_waste_list.get(position).getDate2().substring(8,10);


databaseReference.child("challenge_board").child(zero_waste_list.get(position).getUserid()+"").child(s).child("likes").updateChildren(updatechild);
// 한번 db에서 읽어와보기
zero_waste_list.get(position).setHeartflag("1");
zero_waste_list.get(position).setHeart_number2((Integer.parseInt(zero_waste_list.get(position).getHeart_number2())+1)+"");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package com.example.amongearth.record;

import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.drawable.BitmapDrawable;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.util.Log;
import android.view.Gravity;
Expand Down Expand Up @@ -54,6 +56,7 @@ protected void onCreate(Bundle savedInstanceState) {
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_popup);


mDatabase = FirebaseDatabase.getInstance().getReference();

Intent intent = getIntent();
Expand All @@ -72,6 +75,20 @@ protected void onCreate(Bundle savedInstanceState) {

}

@Override

public void setRequestedOrientation(int requestedOrientation){

if(Build.VERSION.SDK_INT != Build.VERSION_CODES.O){

super.setRequestedOrientation(requestedOrientation);

}

}



//동작 버튼 클릭
public void mYes(View v){
firebaseAuth = FirebaseAuth.getInstance();
Expand Down

0 comments on commit f3600c9

Please sign in to comment.