Skip to content

Commit

Permalink
[fix] fixed bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
mskteknasyon committed Nov 27, 2019
1 parent e1b6079 commit 644afdc
Show file tree
Hide file tree
Showing 45 changed files with 111 additions and 87 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@ import android.content.Context
import android.graphics.Color
import android.util.AttributeSet
import androidx.constraintlayout.widget.ConstraintLayout
import com.teknasyon.desk360.helper.Desk360Constants


class Desk360CommonBottomBar : ConstraintLayout {

init {

// this.setBackgroundColor(Color.parseColor(Desk360Constants.currentType?.data?.general_settings?.copyright_background_color))
this.setBackgroundColor(Color.parseColor("#71717b"))
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,11 @@ package com.teknasyon.desk360.themev2

import android.content.Context
import android.graphics.Color
import android.graphics.Paint
import android.graphics.drawable.GradientDrawable
import android.graphics.drawable.ShapeDrawable
import android.graphics.drawable.shapes.RectShape
import android.os.Build
import android.util.AttributeSet
import android.util.DisplayMetrics
import androidx.constraintlayout.widget.ConstraintLayout
import com.teknasyon.desk360.helper.Desk360Constants
import com.teknasyon.desk360.helper.Desk360Constants.currentType


Expand All @@ -22,7 +18,7 @@ class Desk360CommonButton : ConstraintLayout {

gradientDrawable.setColor(Color.parseColor(currentType?.data?.first_screen?.button_background_color))
gradientDrawable.setStroke(
1,
2,
Color.parseColor(currentType?.data?.first_screen?.button_border_color)
)
if(currentType?.data?.first_screen?.button_shadow_is_hidden!=true){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ package com.teknasyon.desk360.themev2

import android.content.Context
import android.graphics.Color
import android.graphics.Typeface
import android.util.AttributeSet
import android.widget.TextView
import com.teknasyon.desk360.R
import com.teknasyon.desk360.helper.Desk360Constants.currentType

class Desk360CommonButtonText : TextView {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package com.teknasyon.desk360.themev2

import android.content.Context
import android.graphics.Color
import android.graphics.Typeface
import android.util.AttributeSet
import android.view.View
import android.widget.TextView
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class Desk360CreateScreenButton : ConstraintLayout {
init {
gradientDrawable.setColor(Color.parseColor(Desk360Constants.currentType?.data?.create_screen?.button_background_color))
gradientDrawable.setStroke(
1,
2,
Color.parseColor(Desk360Constants.currentType?.data?.create_screen?.button_border_color)
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package com.teknasyon.desk360.themev2

import android.content.Context
import android.graphics.Color
import android.graphics.Typeface
import android.util.AttributeSet
import android.widget.TextView
import com.teknasyon.desk360.helper.Desk360Constants
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package com.teknasyon.desk360.themev2

import android.content.Context
import android.graphics.Color
import android.graphics.Typeface
import android.util.AttributeSet
import android.widget.TextView
import com.teknasyon.desk360.helper.Desk360Constants
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ package com.teknasyon.desk360.themev2

import android.content.Context
import android.graphics.Color
import android.graphics.PorterDuff
import android.graphics.Typeface
import android.os.Build
import android.util.AttributeSet
import android.widget.TextView
import com.teknasyon.desk360.R
Expand All @@ -14,20 +16,39 @@ class Desk360IncomingText : TextView {
init {

when (Desk360Constants.currentType?.data?.ticket_detail_screen?.button_style_id) {
1, 2, 4 -> {
1 -> {

this.setBackgroundResource(R.drawable.incoming_messages_background_type1)
this.setBackgroundResource(R.drawable.incoming_message_background_1)
}
3, 5 -> {
this.setBackgroundResource(R.drawable.incoming_messages_background_type2)
2-> {
this.setBackgroundResource(R.drawable.incoming_message_background_2)
}
3-> {
this.setBackgroundResource(R.drawable.incoming_message_background_2)
}
4-> {
this.setBackgroundResource(R.drawable.incoming_message_background_4)
}

else -> {
this.setBackgroundResource(R.drawable.incoming_messages_background_type1)
this.setBackgroundResource(R.drawable.incoming_message_background_1)

}
}


if(Desk360Constants.currentType?.data?.ticket_detail_screen?.chat_receiver_shadow_is_hidden!=true){
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
this.elevation=20f
}
}


this.background.setColorFilter(
Color.parseColor(Desk360Constants.currentType?.data?.ticket_detail_screen?.chat_receiver_background_color),
PorterDuff.Mode.SRC_ATOP
)

this.setTextColor(Color.parseColor(Desk360Constants.currentType?.data?.ticket_detail_screen?.chat_receiver_text_color))
this.textSize =
Desk360Constants.currentType?.data?.ticket_detail_screen?.chat_receiver_font_size!!.toFloat()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package com.teknasyon.desk360.themev2

import android.content.Context
import android.graphics.Color
import android.graphics.Typeface
import android.util.AttributeSet
import android.widget.TextView
import com.teknasyon.desk360.helper.Desk360Constants
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Desk360PreScreenButton : ConstraintLayout {
init {
gradientDrawable.setColor(Color.parseColor(Desk360Constants.currentType?.data?.create_pre_screen?.button_background_color))
gradientDrawable.setStroke(
1,
2,
Color.parseColor(Desk360Constants.currentType?.data?.create_pre_screen?.button_border_color)
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package com.teknasyon.desk360.themev2

import android.content.Context
import android.graphics.Color
import android.graphics.Typeface
import android.util.AttributeSet
import android.widget.TextView
import com.teknasyon.desk360.helper.Desk360Constants
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package com.teknasyon.desk360.themev2

import android.content.Context
import android.graphics.Color
import android.graphics.Typeface
import android.util.AttributeSet
import android.widget.TextView
import com.teknasyon.desk360.helper.Desk360Constants
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Desk360SendFormButton : Button {
Desk360Constants.currentType?.data?.ticket_detail_screen?.button_text_font_size!!.toFloat()
gradientDrawable.setColor(Color.parseColor(Desk360Constants.currentType?.data?.ticket_detail_screen?.button_background_color))
gradientDrawable.setStroke(
1,
2,
Color.parseColor(Desk360Constants.currentType?.data?.ticket_detail_screen?.button_border_color)
)
when (Desk360Constants.currentType?.data?.ticket_detail_screen?.button_text_font_weight) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ package com.teknasyon.desk360.themev2

import android.content.Context
import android.graphics.Color
import android.graphics.PorterDuff
import android.graphics.Typeface
import android.os.Build
import android.util.AttributeSet
import android.widget.TextView
import com.teknasyon.desk360.R
Expand All @@ -14,72 +16,94 @@ class Desk360SentMessageLayout : TextView {
init {

when (Desk360Constants.currentType?.data?.ticket_detail_screen?.chat_box_style) {
1 ,2,4-> {
1 -> {

this.setBackgroundResource(R.drawable.sent_message_background)
this.setBackgroundResource(R.drawable.sent_message_background_1)
}
3,5 -> {
this.setBackgroundResource(R.drawable.send_messages_background_type2)
2 -> {
this.setBackgroundResource(R.drawable.sent_message_background_2)
}
3 -> {
this.setBackgroundResource(R.drawable.sent_message_background_2)
}
4 -> {
this.setBackgroundResource(R.drawable.sent_message_background_4)
}

else ->{
this.setBackgroundResource(R.drawable.sent_message_background)
else -> {
this.setBackgroundResource(R.drawable.sent_message_background_1)

}

}

this.setTextColor(Color.parseColor(Desk360Constants.currentType?.data?.ticket_detail_screen?.chat_sender_text_color))
this.textSize = Desk360Constants.currentType?.data?.ticket_detail_screen?.chat_sender_font_size!!.toFloat()

when(Desk360Constants.currentType?.data?.ticket_detail_screen?.chat_sender_font_weight){
100 -> {
val face = Typeface.createFromAsset(context?.assets, "Montserrat-Thin.ttf")
this.typeface = face
}
200 -> {
val face = Typeface.createFromAsset(context?.assets, "Montserrat-ExtraLight.ttf")
this.typeface = face
}
300 -> {
val face = Typeface.createFromAsset(context?.assets, "Montserrat-Light.ttf")
this.typeface = face
}
400 -> {
val face = Typeface.createFromAsset(context?.assets, "Montserrat-Regular.ttf")
this.typeface = face
}
500 -> {
val face = Typeface.createFromAsset(context?.assets, "Montserrat-Medium.ttf")
this.typeface = face
}
600 -> {
val face = Typeface.createFromAsset(context?.assets, "Montserrat-SemiBold.ttf")
this.typeface = face
}
700 -> {
val face = Typeface.createFromAsset(context?.assets, "Montserrat-Bold.ttf")
this.typeface = face
}
800 -> {
val face = Typeface.createFromAsset(context?.assets, "Montserrat-ExtraBold.ttf")
this.typeface = face
}
900 -> {
val face = Typeface.createFromAsset(context?.assets, "Montserrat-Black.ttf")
this.typeface = face
}
else -> {
val face = Typeface.createFromAsset(context?.assets, "Montserrat-Regular.ttf")
this.typeface = face
}
if(Desk360Constants.currentType?.data?.ticket_detail_screen?.chat_sender_shadow_is_hidden!=true){
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
this.elevation=20f
}
}
}

this.background.setColorFilter(
Color.parseColor(Desk360Constants.currentType?.data?.ticket_detail_screen?.chat_sender_background_color),
PorterDuff.Mode.SRC_ATOP
)

this.setTextColor(Color.parseColor(Desk360Constants.currentType?.data?.ticket_detail_screen?.chat_sender_text_color))
this.textSize =
Desk360Constants.currentType?.data?.ticket_detail_screen?.chat_sender_font_size!!.toFloat()

when (Desk360Constants.currentType?.data?.ticket_detail_screen?.chat_sender_font_weight) {
100 -> {
val face = Typeface.createFromAsset(context?.assets, "Montserrat-Thin.ttf")
this.typeface = face
}
200 -> {
val face = Typeface.createFromAsset(context?.assets, "Montserrat-ExtraLight.ttf")
this.typeface = face
}
300 -> {
val face = Typeface.createFromAsset(context?.assets, "Montserrat-Light.ttf")
this.typeface = face
}
400 -> {
val face = Typeface.createFromAsset(context?.assets, "Montserrat-Regular.ttf")
this.typeface = face
}
500 -> {
val face = Typeface.createFromAsset(context?.assets, "Montserrat-Medium.ttf")
this.typeface = face
}
600 -> {
val face = Typeface.createFromAsset(context?.assets, "Montserrat-SemiBold.ttf")
this.typeface = face
}
700 -> {
val face = Typeface.createFromAsset(context?.assets, "Montserrat-Bold.ttf")
this.typeface = face
}
800 -> {
val face = Typeface.createFromAsset(context?.assets, "Montserrat-ExtraBold.ttf")
this.typeface = face
}
900 -> {
val face = Typeface.createFromAsset(context?.assets, "Montserrat-Black.ttf")
this.typeface = face
}
else -> {
val face = Typeface.createFromAsset(context?.assets, "Montserrat-Regular.ttf")
this.typeface = face
}
}
}


constructor(context: Context) : super(context)

constructor(context: Context, attrs: AttributeSet) : super(context, attrs)

constructor(context: Context, attrs: AttributeSet, defStyle: Int) : super(context, attrs, defStyle)
constructor(context: Context, attrs: AttributeSet, defStyle: Int) : super(
context,
attrs,
defStyle
)
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
package com.teknasyon.desk360.themev2

import android.content.Context
import android.graphics.Color
import android.util.AttributeSet
import android.widget.Spinner
import com.teknasyon.desk360.R
import com.teknasyon.desk360.helper.Desk360Constants

class Desk360Spinner : Spinner {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package com.teknasyon.desk360.themev2

import android.content.Context
import android.graphics.Color
import android.graphics.Typeface
import android.util.AttributeSet
import android.widget.TextView
import com.teknasyon.desk360.helper.Desk360Constants
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Desk360TicketDetailScreenButton : ConstraintLayout {
init {
gradientDrawable.setColor(Color.parseColor(Desk360Constants.currentType?.data?.ticket_detail_screen?.button_background_color))
gradientDrawable.setStroke(
1,
2,
Color.parseColor(Desk360Constants.currentType?.data?.ticket_detail_screen?.button_border_color)
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class Desk360TicketListEmptyButton : ConstraintLayout {
init {
gradientDrawable.setColor(Color.parseColor(currentType?.data?.first_screen?.button_text_color))
gradientDrawable.setStroke(
1,
2,
Color.parseColor(currentType?.data?.first_screen?.button_border_color)
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package com.teknasyon.desk360.themev2

import android.content.Context
import android.graphics.Color
import android.graphics.Typeface
import android.util.AttributeSet
import android.widget.TextView
import com.teknasyon.desk360.helper.Desk360Constants
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Desk360TicketListMessageLayout : LinearLayout {

gradientDrawable.setColor(Color.parseColor(Desk360Constants.currentType?.data?.ticket_detail_screen?.write_message_background_color))
gradientDrawable.setStroke(
1,
2,
Color.parseColor(Desk360Constants.currentType?.data?.ticket_detail_screen?.write_message_border_color)
)
gradientDrawable.cornerRadius = 1f
Expand Down
Loading

0 comments on commit 644afdc

Please sign in to comment.