Skip to content

animations added to fragment transaction for better performance #3

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

Closed
wants to merge 2 commits into from
Closed
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
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.anant.codingguide.activity

//import android.widget.Toolbar

import android.content.DialogInterface
import android.os.Bundle
Expand All @@ -17,6 +16,7 @@ import com.anant.codingguide.R
import com.anant.codingguide.fragment.*
import com.google.android.material.navigation.NavigationView
import androidx.appcompat.app.AlertDialog.Builder
import androidx.fragment.app.FragmentTransaction


class ControlActivity : AppCompatActivity() {
Expand Down Expand Up @@ -71,23 +71,29 @@ class ControlActivity : AppCompatActivity() {
R.id.language->{
supportFragmentManager.beginTransaction().replace(R.id.frame,
LanguagesFragment()
).commit()
)
.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kindly use some other animation.

.commit()
supportActionBar?.title="Programming languages"
drawerLayout.closeDrawers()
}

R.id.dev->{
supportFragmentManager.beginTransaction().replace(R.id.frame,
DevelopmentFragment()
).commit()
)
.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kindly use some other animation.

.commit()
supportActionBar?.title="Software Development"
drawerLayout.closeDrawers()
}

R.id.quest->{
supportFragmentManager.beginTransaction().replace(R.id.frame,
CompetitiveProgrammingFragment()
).commit()
)
.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE)
.commit()
supportActionBar?.title="Competitive programming"
drawerLayout.closeDrawers()
}
Expand All @@ -97,7 +103,9 @@ class ControlActivity : AppCompatActivity() {
R.id.compiler->{
supportFragmentManager.beginTransaction().replace(R.id.frame,
CompilerFragment()
).commit()
)
.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE)
.commit()
supportActionBar?.title="Test your Code"
drawerLayout.closeDrawers()
}
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/drawable/mybutton.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
android:shape="rectangle" >

<solid android:color="#20b6d9"/>
<corners android:radius="150dp"/>
<corners android:radius="8dp"/>

</shape>
1 change: 0 additions & 1 deletion app/src/main/res/layout/activity_control.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/ThemeOverlay.AppCompat.Dark"
android:elevation="0dp">


Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_splash.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#bbdefb"
android:background="@color/blueOcean"
tools:context=".activity.SplashActivity">


Expand Down
11 changes: 7 additions & 4 deletions app/src/main/res/layout/activity_welcome.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".activity.WelcomeActivity"
android:background="#bbdefb">
android:background="@color/blueOcean">


<TextView
Expand All @@ -15,14 +15,16 @@
android:text="@string/welcome_to_coding_guide"
android:layout_centerHorizontal="true"
android:textSize="28sp"
android:textColor="#1a237e"
android:textStyle="bold"
android:textColor="@color/colorPrimaryDark"
android:padding="16dp"
android:layout_marginTop="40dp" />

<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/cod"
android:elevation="4dp"
android:layout_below="@id/txtWelcome"
android:layout_centerHorizontal="true"
android:layout_marginTop="50dp"/>
Expand All @@ -33,9 +35,10 @@
android:layout_height="wrap_content"
android:layout_below="@id/txtWelcome"
android:layout_centerInParent="true"
android:elevation="4dp"
android:layout_marginTop="300dp"
android:background="@color/colorPrimary"
android:textColor="#000000"
android:background="@drawable/mybutton"
android:textColor="@color/white"
android:text="Get Started"/>


Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/layout/drawer_header.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
android:layout_below="@id/imgLogo"
android:textSize="38sp"
android:layout_centerInParent="true"
android:textColor="@color/colorPrimaryDark" />
android:textStyle="bold"
android:textColor="@color/white" />

</RelativeLayout>
12 changes: 9 additions & 3 deletions app/src/main/res/layout/fragment_competitiveprogramming.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
<RelativeLayout
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".fragment.CompetitiveProgrammingFragment"
android:background="#bbdefb">
android:background="@color/blueOcean">


<TextView
Expand Down Expand Up @@ -228,4 +232,6 @@



</RelativeLayout>
</RelativeLayout>

</androidx.core.widget.NestedScrollView>
2 changes: 1 addition & 1 deletion app/src/main/res/layout/fragment_compiler.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".fragment.CompilerFragment"
android:background="#bbdefb">
android:background="@color/blueOcean">

<TextView
android:id="@+id/txtReady"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/fragment_development.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#bbdefb">
android:background="@color/blueOcean">

<RelativeLayout
android:layout_width="match_parent"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/fragment_home.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#bbdefb"
android:background="@color/blueOcean"
tools:context=".fragment.HomeFragment">


Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/fragment_languages.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#bbdefb">
android:background="@color/blueOcean">

<RelativeLayout
android:layout_width="match_parent"
Expand Down
3 changes: 3 additions & 0 deletions app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@
<color name="colorPrimary">#4dabf5</color>
<color name="colorPrimaryDark">#1769aa</color>
<color name="colorAccent">#2196f3</color>

<color name="white">#FFFFFF</color>
<color name="blueOcean">#bbdefb</color>
</resources>