Skip to content

Commit

Permalink
refactor!: minor ui changes
Browse files Browse the repository at this point in the history
  • Loading branch information
vamsii777 committed Jun 24, 2021
1 parent 2b8252e commit b674210
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 58 deletions.
20 changes: 10 additions & 10 deletions app/src/main/java/download/crossally/apps/hizkiyyah/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -171,16 +171,16 @@ class MainActivity : AppCompatActivity(){
}
return@OnNavigationItemSelectedListener true
}
R.id.nav_explore -> {
fragmentClass = ExploreFragment::class.java
try {
fragment = fragmentClass.newInstance() as Fragment
loadFragment(fragment, menuItem)
} catch (e: Exception) {
e.printStackTrace()
}
return@OnNavigationItemSelectedListener true
}
// R.id.nav_explore -> {
// fragmentClass = ExploreFragment::class.java
// try {
// fragment = fragmentClass.newInstance() as Fragment
// loadFragment(fragment, menuItem)
// } catch (e: Exception) {
// e.printStackTrace()
// }
// return@OnNavigationItemSelectedListener true
// }
// R.id.nav_meeting_history -> {
// fragmentClass = MeetingHistoryFragment::class.java
// try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import android.provider.Settings
import android.text.Editable
import android.text.TextUtils
import android.text.TextWatcher
import android.util.Log
import android.view.*
import android.widget.*
import androidx.core.app.ActivityCompat
Expand Down Expand Up @@ -106,7 +107,7 @@ class HomeFragment : Fragment(), OnDatabaseDataChanged{
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
}

private final var TAG = "HomeFrag"
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
val view = inflater.inflate(R.layout.fragment_home, container, false)
ButterKnife.bind(this, view)
Expand All @@ -123,46 +124,36 @@ class HomeFragment : Fragment(), OnDatabaseDataChanged{

val adRequest = AdRequest.Builder().build()

InterstitialAd.load(requireActivity(),"ca-app-pub-3940256099942544/1033173712", adRequest, object : InterstitialAdLoadCallback() {
InterstitialAd.load(requireContext(),"ca-app-pub-3940256099942544/1033173712", adRequest, object : InterstitialAdLoadCallback() {
override fun onAdFailedToLoad(adError: LoadAdError) {
//Log.d(TAG, adError?.message)
Log.d(TAG, adError?.message)
mInterstitialAd = null
}

override fun onAdLoaded(interstitialAd: InterstitialAd) {
//Log.d(TAG, 'Ad was loaded.')
Log.d(TAG, "Ad was loaded.".toString())
mInterstitialAd = interstitialAd
}
})

//mInterstitialAd!!.adUnitId = getString(R.string.meet_interstitial)

bindAdvtView()
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
if (!checkAppPermissions(appPermissions)) {
requestAppPermissions(appPermissions)
}
}
mFirebaseAnalytics = FirebaseAnalytics.getInstance(requireActivity());
loadInterstitial()
return view
}

private fun loadInterstitial() {
val adRequest = AdRequest.Builder() // .addTestDevice("23F1C653C3AF44D748738885C1F91FDA")
.build()

// Load ads into Interstitial Ads
//mInterstitialAd!!.loadAd(adRequest)
// mInterstitialAd!!.adListener = object : AdListener() {
// override fun onAdLoaded() {
// showInterstitial()
// }
//}
}

private fun showInterstitial() {
// if (mInterstitialAd!!.isLoaded) {
// mInterstitialAd!!.show()
// }
if (mInterstitialAd != null) {
mInterstitialAd?.show(requireActivity())
} else {
Log.d("TAG", "The interstitial ad wasn't ready yet.")
}
}

private fun bindAdvtView() {
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/drawable/ic_launcher_foreground.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
android:translateY="21">
<path
android:pathData="m12,23.25c-6.204,0 -11.25,-5.047 -11.25,-11.25s5.046,-11.25 11.25,-11.25 11.25,5.047 11.25,11.25 -5.046,11.25 -11.25,11.25z"
android:fillColor="#2196f3"/>
android:fillColor="#1B90F6"/>
<path
android:pathData="m19.25,9.15v5.7c0,0.39 -0.43,0.63 -0.77,0.42l-3.23,-2.02v1.5c0,0.83 -0.67,1.5 -1.5,1.5h-7.5c-0.83,0 -1.5,-0.67 -1.5,-1.5v-5.5c0,-0.83 0.67,-1.5 1.5,-1.5h7.5c0.83,0 1.5,0.67 1.5,1.5v1.5l3.23,-2.02c0.34,-0.21 0.77,0.03 0.77,0.42z"
android:fillColor="#fafafa"/>
Expand Down
22 changes: 5 additions & 17 deletions app/src/main/res/layout/activity_login.xml
Original file line number Diff line number Diff line change
Expand Up @@ -101,36 +101,24 @@

<com.google.android.material.button.MaterialButton
android:id="@+id/btnLogin"
android:layout_width="180dp"
android:layout_width="match_parent"
android:layout_gravity="center"
android:layout_height="wrap_content"
android:layout_height="59dp"
android:text="@string/login"
android:layout_marginTop="15dp"
android:layout_marginLeft="25dp"
android:layout_marginRight="25dp"
android:textColor="@color/white"
android:textAllCaps="true"
android:textSize="14sp"
app:rippleColor="@color/colorPrimaryRipple"
app:backgroundTint="@color/colorPrimary"
app:cornerRadius="20dp" />
app:cornerRadius="4dp" />

<TextView
android:paddingTop="15dp"
android:paddingBottom="15dp"
android:textSize="13sp"
android:gravity="center"
android:textColor="@color/secondaryText"
android:text="OR continue with"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>

<com.google.android.gms.common.SignInButton
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/btnGoogleSignIn"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="16dp"
android:layout_marginBottom="20dp"/>

</LinearLayout>
Expand Down
7 changes: 3 additions & 4 deletions app/src/main/res/layout/activity_register.xml
Original file line number Diff line number Diff line change
Expand Up @@ -123,18 +123,17 @@
<com.google.android.material.button.MaterialButton
android:id="@+id/btnRegister"
android:layout_marginTop="15dp"
android:layout_marginLeft="25dp"
android:layout_marginRight="25dp"

android:layout_width="match_parent"
android:layout_gravity="center"
android:layout_height="wrap_content"
android:layout_height="59dp"
android:text="@string/register"
android:textColor="@color/white"
android:textAllCaps="true"
android:textSize="14sp"
app:rippleColor="@color/colorPrimaryRipple"
app:backgroundTint="@color/colorPrimary"
app:cornerRadius="10dp" />
app:cornerRadius="4dp" />

<TextView
android:paddingTop="15dp"
Expand Down
10 changes: 5 additions & 5 deletions app/src/main/res/menu/bottom_navigation_menu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
android:icon="@drawable/ic_home"
android:title="@string/menu_home" />

<item
android:id="@+id/nav_explore"
android:icon="@drawable/ic_outline_explore_24"
android:visible="true"
android:title="@string/explore" />
<!-- <item-->
<!-- android:id="@+id/nav_explore"-->
<!-- android:icon="@drawable/ic_outline_explore_24"-->
<!-- android:visible="true"-->
<!-- android:title="@string/explore" />-->

<!-- <item-->
<!-- android:id="@+id/nav_meeting_history"-->
Expand Down

0 comments on commit b674210

Please sign in to comment.