Skip to content

Commit

Permalink
#88 modify gradient, edittext, ...
Browse files Browse the repository at this point in the history
  • Loading branch information
최준영 authored and 최준영 committed Aug 16, 2018
1 parent 40e8701 commit 1bc49aa
Show file tree
Hide file tree
Showing 13 changed files with 442 additions and 297 deletions.
3 changes: 3 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,7 @@ dependencies {
// Google map
implementation 'com.google.android.gms:play-services-maps:15.0.1'
implementation 'com.google.android.gms:play-services-location:15.0.1'

// Coordinator layout
implementation 'cn.hugeterry.coordinatortablayout:coordinatortablayout:1.2.2'
}
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ public void onPermissionDenied(ArrayList<String> deniedPermissions) {

tabLayout.setTabGravity(TabLayout.GRAVITY_FILL);


// Initializing ViewPager
viewPager = findViewById(R.id.viewpager);
viewPager.setOverScrollMode(View.OVER_SCROLL_NEVER);
Expand All @@ -102,11 +101,11 @@ public void onTabSelected(TabLayout.Tab tab) {
nolgang_img.setImageResource(R.drawable.ic_nolgang_icon_active);
nolgang_text.setTextColor(Color.parseColor("#2186f8"));
}
if(tab.getPosition()==1) {
else if(tab.getPosition()==1) {
mypage_img.setImageResource(R.drawable.ic_mypage_icon_active);
mypage_text.setTextColor(Color.parseColor("#2186f8"));
}
if(tab.getPosition()==2) {
else if(tab.getPosition()==2) {
mapPageImg.setImageResource(R.drawable.ic_tap_map_active);
mapPageText.setTextColor(Color.parseColor("#2186f8"));
}
Expand All @@ -118,11 +117,11 @@ public void onTabUnselected(TabLayout.Tab tab) {
nolgang_img.setImageResource(R.drawable.ic_nolgang_icon);
nolgang_text.setTextColor(Color.parseColor("#333333"));
}
if(tab.getPosition()==1) {
else if(tab.getPosition()==1) {
mypage_img.setImageResource(R.drawable.ic_mypage_icon);
mypage_text.setTextColor(Color.parseColor("#333333"));
}
if(tab.getPosition()==2) {
else if(tab.getPosition()==2) {
mapPageImg.setImageResource(R.drawable.ic_tap_map);
mapPageText.setTextColor(Color.parseColor("#333333"));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.depromeet.hanriver.hanrivermeetup.fragment.meeting;

import android.app.TimePickerDialog;
import android.content.Context;
import android.graphics.Color;
import android.os.AsyncTask;
import android.os.Bundle;
Expand All @@ -15,10 +16,12 @@
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.inputmethod.InputMethodManager;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.TimePicker;
import android.widget.Toast;
Expand Down Expand Up @@ -61,6 +64,7 @@ public class MeetingCreateRoom extends DialogFragment{
int activity_seq;
DialogFragment dial;
MeetingListFragment fragment;
RelativeLayout rl;

@Override
public void onCreate(Bundle savedInstanceState) {
Expand Down Expand Up @@ -100,6 +104,18 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
}

private void setupViews(View v) {

//화면 터치 시, 키보드 내려가게 하기 위한 클릭 이벤트.
rl = v.findViewById(R.id.create_room_rl);
rl.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
InputMethodManager imm = (InputMethodManager)getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(v.getWindowToken(), 0);
}
});


back_btn = v.findViewById(R.id.create_room_back_btn);
back_btn.setOnClickListener(back_click);
nickname = v.findViewById(R.id.create_room_nickname);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.depromeet.hanriver.hanrivermeetup.fragment.meeting;

import android.content.Context;
import android.graphics.Color;
import android.os.Bundle;
import android.support.annotation.NonNull;
Expand All @@ -11,10 +12,12 @@
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.inputmethod.InputMethodManager;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.ScrollView;
import android.widget.TextView;

Expand Down Expand Up @@ -51,12 +54,13 @@ public class MeetingDetailFragment extends DialogFragment {
Button comment_btn, join_btn;
EditText comment_text;
ImageView profile_img;
ImageButton back_btn;
ImageButton back_btn,modify_btn;
ScrollView scroll;
TextView room_title, profile_name, detail_info, detail_location, detail_content, joinbtn_border;
int meeting_seq;
String room_master_name;
MeetingDetailFragment self;
RelativeLayout rl;


@Override
Expand Down Expand Up @@ -88,6 +92,8 @@ public static MeetingDetailFragment newInstance(int meeting_seq) {


private void setupViews(View v) {

modify_btn = v.findViewById(R.id.detail_room_modify_btn);
joinbtn_border =v.findViewById(R.id.border_join_Btn);
scroll = v.findViewById(R.id.detail_scroll);
scroll.setOverScrollMode(View.OVER_SCROLL_NEVER);
Expand Down Expand Up @@ -130,6 +136,15 @@ public void onClick(View view) {
comment_text.setText("");
}
});

rl = v.findViewById(R.id.detail_rl);
rl.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
InputMethodManager imm = (InputMethodManager)getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(v.getWindowToken(), 0);
}
});
}


Expand Down Expand Up @@ -214,11 +229,17 @@ private void setMeetingDetail(@NonNull final MeetingDetail meetingDetail) {
.transform(CircleTransform.getInstance()).into(profile_img);

if (meetingDetail.getUser_id().equals(LoginFragment.getUser_id())) {
join_btn.setBackgroundColor(Color.parseColor("#aaaaaa"));
join_btn.setEnabled(false);
join_btn.setText("내가 만든 방입니다");
join_btn.setTextColor(Color.parseColor("#ffffff"));
joinbtn_border.setBackgroundColor(Color.parseColor("#dcdcdc"));
// join_btn.setBackgroundColor(Color.parseColor("#aaaaaa"));
// join_btn.setEnabled(false);
// join_btn.setText("내가 만든 방입니다");
// join_btn.setTextColor(Color.parseColor("#ffffff"));
// joinbtn_border.setBackgroundColor(Color.parseColor("#dcdcdc"));
join_btn.setVisibility(View.GONE);
joinbtn_border.setVisibility(View.GONE);
RelativeLayout.LayoutParams lp = (RelativeLayout.LayoutParams) join_btn.getLayoutParams();
lp.setMargins(0,0,0,0);
join_btn.setLayoutParams(lp);
modify_btn.setVisibility(View.VISIBLE);
}
// TestFrag frag = new TestFrag();
// FragmentManager fragmentManager = getFragmentManager();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import android.support.v4.app.FragmentManager;
import android.support.v4.view.ViewPager;
import android.util.Log;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
Expand All @@ -27,7 +28,7 @@

import java.sql.Time;

public class MeetingListFragment extends Fragment{
public class MeetingListFragment extends Fragment {

private FloatingActionButton fab;
private ViewPager viewpager;
Expand All @@ -37,22 +38,27 @@ public class MeetingListFragment extends Fragment{
ImageView category_img;
static int image_num[];
MeetingListFragment frag;
View tabs[];
TextView tabname[];

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
frag = this;
tabs = new View[6];
tabname = new TextView[6];
image_num = new int[6];
image_num[0]=R.drawable.ic_chicken_white;
image_num[1]=R.drawable.ic_bike_icon_white;
image_num[2]=R.drawable.ic_ori_icon_white;
image_num[3]=R.drawable.ic_camping_icon_white;
image_num[4]=R.drawable.ic_photo_icon_white;
image_num[5]=R.drawable.ic_etc_icon_white;
image_num[0] = R.drawable.ic_chicken_white;
image_num[1] = R.drawable.ic_bike_icon_white;
image_num[2] = R.drawable.ic_ori_icon_white;
image_num[3] = R.drawable.ic_camping_icon_white;
image_num[4] = R.drawable.ic_photo_icon_white;
image_num[5] = R.drawable.ic_etc_icon_white;
}

public static MeetingListFragment newInstance(int position) {
current_position = position;
Log.d("position:",""+current_position);
Log.d("position:", "" + current_position);
Bundle args = new Bundle();
MeetingListFragment fragment = new MeetingListFragment();
fragment.setArguments(args);
Expand All @@ -69,17 +75,28 @@ private void setupViews(View v) {
MainActivity.tabVisible(View.GONE);
viewpager = v.findViewById(R.id.meeting_list_vp);
viewpager.setOverScrollMode(View.OVER_SCROLL_NEVER);
Log.d("TAG","setupViews");
Log.d("TAG", "setupViews");
tabLayout = v.findViewById(R.id.list_tablayout);
tabLayout.addTab(tabLayout.newTab().setText("치킨"));
tabLayout.addTab(tabLayout.newTab().setText("자전거"));
tabLayout.addTab(tabLayout.newTab().setText("오리배"));
tabLayout.addTab(tabLayout.newTab().setText("캠핑"));
tabLayout.addTab(tabLayout.newTab().setText("사진"));
tabLayout.addTab(tabLayout.newTab().setText("기타"));

for (int i = 0; i < 6; i++) {
tabs[i] = getLayoutInflater().inflate(R.layout.tab_meeting_list, null);
tabname[i] = tabs[i].findViewById(R.id.meeting_list_tab_name);
tabLayout.addTab(tabLayout.newTab().setCustomView(tabs[i]));
}
tabname[0].setText("치킨");
tabname[1].setText("자전거");
tabname[2].setText("오리배");
tabname[3].setText("캠핑");
tabname[4].setText("사진");
tabname[5].setText("기타");
tabname[current_position].setTypeface(null,Typeface.BOLD);//선택되어 들어온 아이템을 볼드체로 변경.


tabLayout.setOverScrollMode(View.OVER_SCROLL_NEVER);
tabLayout.setTabRippleColor(null);
// tabLayout.setTabGravity(TabLayout.GRAVITY_FILL);

MeetingListTapPagerAdapter adapter = new MeetingListTapPagerAdapter(getChildFragmentManager(),tabLayout.getTabCount());
MeetingListTapPagerAdapter adapter = new MeetingListTapPagerAdapter(getChildFragmentManager(), tabLayout.getTabCount());
viewpager.setAdapter(adapter);
viewpager.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(tabLayout));
tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
Expand All @@ -88,13 +105,13 @@ private void setupViews(View v) {
public void onTabSelected(TabLayout.Tab tab) {
viewpager.setCurrentItem(tab.getPosition());
current_position = tab.getPosition();
Log.d("position: ",""+current_position);
category_img.setImageResource(image_num[current_position]);

tabname[tab.getPosition()].setTypeface(null,Typeface.BOLD);
}

@Override
public void onTabUnselected(TabLayout.Tab tab) {
tabname[tab.getPosition()].setTypeface(null,Typeface.NORMAL);

}

Expand All @@ -121,7 +138,6 @@ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceStat
super.onViewCreated(view, savedInstanceState);



}

View.OnClickListener mClick = new View.OnClickListener() {
Expand All @@ -133,7 +149,7 @@ public void onClick(View view) {
// fragTransaction.replace(R.id.meeting_root, frag);
// fragTransaction.addToBackStack(null);
// fragTransaction.commit();
MeetingCreateRoom dialog = MeetingCreateRoom.newInstance(current_position+1,frag);
MeetingCreateRoom dialog = MeetingCreateRoom.newInstance(current_position + 1, frag);
dialog.setStyle(DialogFragment.STYLE_NO_TITLE, android.R.style.Theme_Holo_Light);
dialog.show(getFragmentManager(), "tag");

Expand Down
5 changes: 3 additions & 2 deletions app/src/main/res/drawable/back_grad_color.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:angle="90"
android:endColor="#2186f8"
android:startColor="#00c0c9"
android:endColor="@color/clear_blue"
android:centerColor="#1882E4"
android:startColor="#1693D7"
android:type="linear"
android:useLevel="false" />
</shape>
24 changes: 24 additions & 0 deletions app/src/main/res/drawable/textline_top.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">

<solid android:color="#dcdcdc" />

</shape>

</item>

<item
android:top="0.5dp">

<shape android:shape="rectangle">

<solid android:color="#ffffff" />

</shape>

</item>


</layer-list>
Loading

0 comments on commit 1bc49aa

Please sign in to comment.