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

New hr #22

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
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
8 changes: 7 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,22 @@

</activity>
<activity android:name=".LoginRegisterActivity.ChoiceActivity" />
<activity android:name=".LoginRegisterActivity.RegisterActivity_asker" />

<activity android:name=".LoginRegisterActivity.RegisterActivity_asker">
</activity>
<activity android:name=".LoginRegisterActivity.RegisterActivity_helper" /> <!-- Chat -->
<activity android:name=".ChatActivities.ChatActivity" />
<activity android:name=".ChatActivities.HelperChatActivity" /> <!-- Main -->
<activity android:name=".MainActivities.MainActivity">



</activity>
<activity android:name=".MainActivities.HelperActivity">
</activity>

<activity android:name=".MainActivities.HelperActivity">

</activity>
<activity android:name=".HelperProfileEdit.HelperProfileEditActivityHash" />
<activity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,18 @@ public void onCreate(Bundle savedInstanceState) {
Button button5 = findViewById(R.id.helperSU_btn_life);
Button button6 = findViewById(R.id.helperSU_btn_etc);
Button nextbtn = findViewById(R.id.btn_next);
ImageView cancelbtn = findViewById(R.id.cancel_btn);

cancelbtn.setOnClickListener(new Button.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent();
intent.putExtra("result", "BACK");
setResult(REQUEST_CODE, intent);
finish();
}
});

//Button backbtn = (Button) findViewById(R.id.btn_backbtn);

/*ImageView btn_back;*/
Expand Down Expand Up @@ -72,7 +84,6 @@ public void onClick(View view) {
button6.setTextColor(getColor(R.color.lightPurple));
button6.setBackgroundResource(R.drawable.helpersignup_nonchecked);


}


Expand All @@ -94,7 +105,6 @@ public void onClick(View view) {
button6.setTextColor(getColor(R.color.lightPurple));
button6.setBackgroundResource(R.drawable.helpersignup_nonchecked);


}
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
import com.example.appjam_willson.R;





public class HelperProfileEditActivityC2 extends AppCompatActivity {
//다음버튼에 액티비티 2 와 연결 해야함

Expand All @@ -25,6 +22,7 @@ public class HelperProfileEditActivityC2 extends AppCompatActivity {

public void onCreate(Bundle savedInstanceState)
{
context = this;
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_helper_profile_edit_c2);

Expand All @@ -38,9 +36,20 @@ public void onCreate(Bundle savedInstanceState)

// Button backbtn = (Button) findViewById(R.id.btn_backbtn);
ImageView btn_back;
ImageView cancel_btn;

btn_back = findViewById(R.id.back_btn);
btn_back.setOnClickListener(new HelperProfileEditActivityC2.list1_love_backbtn_listener());
btn_back.setOnClickListener(new HelperProfileEditActivityC2.backbtn_listener());
cancel_btn = findViewById(R.id.cancel_btn);
cancel_btn.setOnClickListener(new Button.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent();
intent.putExtra("result", "cancel");
setResult(REQUEST_CODE, intent);
finish();
}
});


text = findViewById(R.id.toolbar_text);
Expand Down Expand Up @@ -139,7 +148,7 @@ public void onClick(View view) {
}


class list1_love_backbtn_listener implements View.OnClickListener {
class backbtn_listener implements View.OnClickListener {
@Override
public void onClick(View view) {
finish();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ public void onComplete(@NonNull Task<InstanceIdResult> task) {
}

String token = task.getResult().getToken();

Map<String,Object> map = new HashMap<>();
map.put("pushToken",token);
FirebaseDatabase.getInstance().getReference().child("users").child(uid).updateChildren(map);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
package com.example.appjam_willson.MainActivities;


import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import androidx.annotation.Nullable;
Expand All @@ -25,21 +27,22 @@ public HelperFragment1_null(){
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.activity_helper_request_empty_received,null);

ImageView willsonImage_receive = (ImageView) getActivity().findViewById(R.id.willsonImage_receive);
ImageView willsonImage_chat = (ImageView) getActivity().findViewById(R.id.willsonImage_chat);
ImageView willsonImage_profile = (ImageView) getActivity().findViewById(R.id.willsonImage_profile);
ImageView willsonImage_mypage = (ImageView) getActivity().findViewById(R.id.willsonImage_mypage);
ImageView willsonImage_receive = getActivity().findViewById(R.id.willsonImage_receive);
ImageView willsonImage_chat = getActivity().findViewById(R.id.willsonImage_chat);
ImageView willsonImage_profile = getActivity().findViewById(R.id.willsonImage_profile);
ImageView willsonImage_mypage = getActivity().findViewById(R.id.willsonImage_mypage);

TextView willsonText_receive = (TextView) getActivity().findViewById(R.id.willsonText_receive);
TextView willsonText_chat = (TextView) getActivity().findViewById(R.id.willsonText_chat);
TextView willsonText_profile = (TextView) getActivity().findViewById(R.id.willsonText_profile);
TextView willsonText_mypage = (TextView) getActivity().findViewById(R.id.willsonText_mypage);
TextView willsonText_receive = getActivity().findViewById(R.id.willsonText_receive);
TextView willsonText_chat = getActivity().findViewById(R.id.willsonText_chat);
TextView willsonText_profile = getActivity().findViewById(R.id.willsonText_profile);
TextView willsonText_mypage = getActivity().findViewById(R.id.willsonText_mypage);

LinearLayout change = view.findViewById(R.id.helper_toAsker);

/* LayoutInflater inflater_tab;
inflater_tab = getLayoutInflater();
View view_tab = inflater_tab.inflate(R.layout.activity_helper, null);*/


Button btn = view.findViewById(R.id.helper_profile_edit_btn);

/* final ImageView willsonImage_receive= view_tab.findViewById(R.id.willsonImage_receive);
Expand All @@ -53,12 +56,19 @@ public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
final TextView willsonText_mypage= view_tab.findViewById(R.id.willsonText_mypage);*/


change.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(getActivity(),MainActivity.class);
startActivity(intent);
}
});

btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
/* willsonImage_profile.setImageResource(R.drawable.helper_tab_03_profile_active);
willsonImage_receive.setImageResource(R.drawable.tab_02_request_nonactive);

willsonText_profile.setTextColor(Color.parseColor("#2f2f2f"));
willsonText_receive.setTextColor(Color.parseColor("#9e9e9e"));*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,16 +115,14 @@ public void onClick(View v) {
button3.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// changeImage(image_chat, image_home, image_mypage, image_request);
// changeTextColor(text_chat, text_home, text_request, text_mypage);
//
// MainFragment3 fragment = new MainFragment3();
// getSupportFragmentManager().beginTransaction().replace(R.id.main_frame, fragment).commit();
thirdTap();
changeImage(image_chat, image_home, image_mypage, image_request);
changeTextColor(text_chat, text_home, text_request, text_mypage);

MainFragment3 fragment = new MainFragment3();
getSupportFragmentManager().beginTransaction().replace(R.id.main_frame, fragment).commit();



}
});

Expand All @@ -140,10 +138,7 @@ public void onClick(View v) {
});
}

public static void thirdTap(){
changeImage(image_chat, image_home, image_mypage, image_request);
changeTextColor(text_chat, text_home, text_request, text_mypage);
}




Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@
import com.example.appjam_willson.R;
import com.example.appjam_willson.model.CreateWorryModel;
import com.example.appjam_willson.model.CreateWorryResponseModel;
import com.example.appjam_willson.model.HelperCheckResponseModel;
import com.example.appjam_willson.model.HelperStoryModel;
import com.example.appjam_willson.model.WorryCategoryListAddResponseModel;
import com.google.android.material.theme.MaterialComponentsViewInflater;

import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -157,10 +159,10 @@ public void onClick(View view) {
changeMode.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//헬퍼 가입했는지 아닌지 판단해서
//Intent intent = new Intent(getActivity() , HelperActivity.class);
Intent intent = new Intent(getActivity() , HelperSignUpStartActivity.class);
startActivity(intent);

Call<HelperCheckResponseModel> user_profile = RetrofitService.getInstance().getService().helper_exist_check_get(token);
user_profile.enqueue(check_retrofitCallback);

}
});

Expand Down Expand Up @@ -205,6 +207,28 @@ public void onClick(View v) {

return view;
}

private Callback<HelperCheckResponseModel> check_retrofitCallback = new Callback<HelperCheckResponseModel>() {
@Override
public void onResponse(Call<HelperCheckResponseModel> call, Response<HelperCheckResponseModel> response) {
HelperCheckResponseModel result = response.body();
if(result.data.status){
Intent intent = new Intent(getActivity(),HelperActivity.class);
startActivity(intent);
}
else{
Intent intent = new Intent(getActivity() , HelperSignUpStartActivity.class);
startActivity(intent);

}

}

@Override
public void onFailure(Call<HelperCheckResponseModel> call, Throwable t) {
Log.d(">>>>>>헬퍼 등록 체크 실패>>>>>>>","실패래요~~~~");
}
};
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data){
super.onActivityResult(requestCode, resultCode, data);
Expand Down Expand Up @@ -250,7 +274,22 @@ public void onResponse(Call<CreateWorryResponseModel> call, Response<CreateWorry
// Intent intent = new Intent(getActivity(),MainActivity.class);
// intent.putExtra("complete","OK");
// startActivity(intent);
MainActivity.thirdTap();

ImageView willsonImage_home = getActivity().findViewById(R.id.Image_home);
ImageView willsonImage_chat = getActivity().findViewById(R.id.Image_chat);
ImageView willsonImage_request = getActivity().findViewById(R.id.Image_request);
ImageView willsonImage_mypage = getActivity().findViewById(R.id.Image_mypage);

TextView willsonText_home = getActivity().findViewById(R.id.text_home);
TextView willsonText_chat = getActivity().findViewById(R.id.text_chat);
TextView willsonText_request = getActivity().findViewById(R.id.text_request);
TextView willsonText_mypage = getActivity().findViewById(R.id.text_mypage);

changeImage(willsonImage_request,willsonImage_chat,willsonImage_mypage,willsonImage_home);
changeTextColor(willsonText_request,willsonText_home,willsonText_chat,willsonText_mypage);

MainFragment2_loading fragment = new MainFragment2_loading();
getFragmentManager().beginTransaction().replace(R.id.main_frame, fragment).commit();


}
Expand Down Expand Up @@ -303,6 +342,21 @@ public void onFailure(Call<HelperStoryModel> call, Throwable t) {
}
};

private void changeImage(ImageView first, ImageView second, ImageView third, ImageView fourth) {
first.setSelected(true);
second.setSelected(false);
third.setSelected(false);
fourth.setSelected(false);
}

private void changeTextColor(TextView first, TextView second, TextView third, TextView fourth) {
first.setTextColor(Color.parseColor("#2f2f2f"));
second.setTextColor(Color.parseColor("#9e9e9e"));
third.setTextColor(Color.parseColor("#9e9e9e"));
fourth.setTextColor(Color.parseColor("#9e9e9e"));
}


// private Callback<MainReviewModel> review_retrofitCallback = new Callback<MainReviewModel>() {
//
// @Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import com.example.appjam_willson.model.ExitChatModel;
import com.example.appjam_willson.model.ExitChatResponseModel;
import com.example.appjam_willson.model.FeelingStatusListResponseModel;
import com.example.appjam_willson.model.HelperCheckResponseModel;
import com.example.appjam_willson.model.HelperProfileEditModel;
import com.example.appjam_willson.model.HelperProfileEditResponseModel;
import com.example.appjam_willson.model.HelperProfileWatchResponseModel;
Expand Down Expand Up @@ -107,4 +108,7 @@ Call<ExitChatResponseModel> exit_chat_put(@Header("willson-token") String token,

@GET("review/story")
Call<MainReviewModel> main_review_get(@Header("willson-token") String token);

@GET("helper/check")
Call<HelperCheckResponseModel> helper_exist_check_get(@Header("willson-token") String token);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.example.appjam_willson.model;

public class HelperCheckResponseModel {
public String message;
public int code;
public Data data;


public class Data{
public boolean status;
}
}
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_helper.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/willsonText_chat"
android:text="보낸 요청"
android:text="채팅"
android:textColor="@color/grey"
android:textSize="12sp"
android:gravity="center"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
xmlns:android="http://schemas.android.com/apk/res/android">

<LinearLayout
android:layout_width="match_parent"
android:id="@+id/helper_toAsker"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="right"
android:layout_gravity="right"
android:layout_marginTop="51.7dp"
>

Expand All @@ -24,15 +26,14 @@
android:textColor="@color/dark_purple"
android:lineSpacingExtra="1sp"
android:text="질문자전환"
android:paddingRight="20dp"
android:layout_gravity="center_vertical"
android:gravity="center_vertical"
android:textStyle="normal"
android:fontFamily="@font/nanum_square_b"
/>

<View
android:layout_width="25.8dp"
android:layout_height="0dp"/>

</LinearLayout>

<LinearLayout
Expand Down