-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from gjsk132/feature/title/lobby-start
[Feature] Lobby Start ( 1 )
- Loading branch information
Showing
25 changed files
with
402 additions
and
121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
99 changes: 99 additions & 0 deletions
99
app/src/main/java/com/gjsk/lootify/customview/DialogBase.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
package com.gjsk.lootify.customview; | ||
|
||
import android.content.Context; | ||
import android.content.res.TypedArray; | ||
import android.util.AttributeSet; | ||
import android.view.LayoutInflater; | ||
import android.view.View; | ||
import android.widget.FrameLayout; | ||
import android.widget.ImageView; | ||
import android.widget.LinearLayout; | ||
import android.widget.TextView; | ||
|
||
import com.gjsk.lootify.R; | ||
|
||
public class DialogBase extends LinearLayout { | ||
TextView subTitle; | ||
TextView description; | ||
ImageView addIcon; | ||
FrameLayout dialogContents; | ||
View buttonLine; | ||
LinearLayout buttonContents; | ||
|
||
public DialogBase(Context context){ | ||
super(context); | ||
initView(); | ||
} | ||
|
||
public DialogBase(Context context, AttributeSet attrs){ | ||
super(context, attrs); | ||
initView(); | ||
getAttrs(attrs); | ||
} | ||
|
||
public DialogBase(Context context, AttributeSet attrs, int defStyle){ | ||
super(context, attrs); | ||
initView(); | ||
getAttrs(attrs, defStyle); | ||
} | ||
|
||
private void initView(){ | ||
String infService = Context.LAYOUT_INFLATER_SERVICE; | ||
LayoutInflater li = (LayoutInflater) getContext().getSystemService(infService); | ||
View v = li.inflate(R.layout.dialog_base, this, false); | ||
addView(v); | ||
|
||
subTitle = (TextView) findViewById(R.id.sub_title); | ||
description = (TextView) findViewById(R.id.description); | ||
addIcon = (ImageView) findViewById(R.id.icon); | ||
dialogContents = (FrameLayout) findViewById(R.id.dialog_contents); | ||
buttonLine = (View) findViewById(R.id.button_line); | ||
buttonContents = (LinearLayout) findViewById(R.id.button_contents); | ||
} | ||
|
||
private void getAttrs(AttributeSet attrs){ | ||
TypedArray typedArray = getContext().obtainStyledAttributes(attrs, R.styleable.DialogBase); | ||
setTypeArray(typedArray); | ||
} | ||
|
||
private void getAttrs(AttributeSet attrs, int defStyle){ | ||
TypedArray typedArray = getContext().obtainStyledAttributes(attrs, R.styleable.DialogBase, defStyle, 0); | ||
setTypeArray(typedArray); | ||
} | ||
|
||
private void setTypeArray(TypedArray typedArray){ | ||
String subTitleString = typedArray.getString(R.styleable.DialogBase_sub_title); | ||
String descriptionString = typedArray.getString(R.styleable.DialogBase_description); | ||
boolean isAddIcon = typedArray.getBoolean(R.styleable.DialogBase_add_icon_visible, false); | ||
boolean isButtons = typedArray.getBoolean(R.styleable.DialogBase_is_buttons, false); | ||
|
||
setTitle(subTitleString); | ||
setDescription(descriptionString); | ||
setIconVisibility(isAddIcon); | ||
setButtonsVisibility(isButtons); | ||
|
||
typedArray.recycle(); | ||
} | ||
|
||
private void setTitle(String text){ | ||
subTitle.setText(text); | ||
} | ||
|
||
private void setDescription(String text){ | ||
description.setText(text); | ||
} | ||
|
||
private void setIconVisibility(boolean isAddIcon){ | ||
addIcon.setVisibility(isAddIcon ? View.VISIBLE : View.GONE); | ||
} | ||
|
||
private void setButtonsVisibility(boolean isButtons){ | ||
if(isButtons){ | ||
buttonLine.setVisibility(View.VISIBLE); | ||
buttonContents.setVisibility(View.VISIBLE); | ||
}else{ | ||
buttonLine.setVisibility(View.GONE); | ||
buttonContents.setVisibility(View.GONE); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<selector xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<item> | ||
<shape> | ||
<corners android:radius="10dp"/> | ||
<stroke android:color="@color/textLightColor" | ||
android:width="1dp"/> | ||
<solid android:color="@color/white"/> | ||
</shape> | ||
</item> | ||
</selector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,43 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:id="@+id/startScreen" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
tools:context=".MapCreator.CreateMap"> | ||
android:background="@color/titleBackgroundColor" | ||
tools:context=".title.StartTitle"> | ||
|
||
</androidx.constraintlayout.widget.ConstraintLayout> | ||
<ImageView | ||
android:contentDescription="@string/contents" | ||
android:layout_height="match_parent" | ||
android:layout_width="wrap_content" | ||
android:scaleType="centerCrop" | ||
android:src="@drawable/create_map_background"/> | ||
|
||
<LinearLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:gravity="center" | ||
android:orientation="vertical"> | ||
|
||
<TextView | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:fontFamily="@font/labrada" | ||
android:text="@string/app_name" | ||
android:textColor="@color/textBasicColor" | ||
android:layout_marginTop="130dp" | ||
android:layout_marginBottom="280dp" | ||
android:textSize="65sp" /> | ||
|
||
<TextView | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:fontFamily="@font/inria_sans" | ||
android:text="Touch to Start" | ||
android:textColor="@color/white" | ||
android:textSize="20sp" /> | ||
|
||
</LinearLayout> | ||
|
||
</FrameLayout> |
Oops, something went wrong.