Skip to content

Commit

Permalink
fix fragments
Browse files Browse the repository at this point in the history
  • Loading branch information
MohitGupta121 committed Jul 21, 2022
1 parent 23bc8e5 commit 4ef09ab
Show file tree
Hide file tree
Showing 15 changed files with 36 additions and 25 deletions.
4 changes: 2 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
android:usesCleartextTraffic="true"
tools:targetApi="m">
<activity
android:name=".activities.Teacher.TeacherFragment"
android:name=".activities.teacher.attendence.TeacherFragment"
android:exported="true"/>
<activity
android:name=".activities.HOD.HodActivity"
android:name=".activities.hod.HodActivity"
android:exported="false" />
<activity
android:name=".activities.LoginActivity"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cmsr.ipsacademy.net.activities.HOD
package cmsr.ipsacademy.net.activities.hod

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cmsr.ipsacademy.net.activities.Principal
package cmsr.ipsacademy.net.activities.principal

import android.os.Bundle
import androidx.fragment.app.Fragment
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cmsr.ipsacademy.net.activities.Teacher
package cmsr.ipsacademy.net.activities.teacher.attendence

import android.os.Bundle
import android.util.Log
Expand All @@ -11,16 +11,16 @@ import androidx.recyclerview.widget.LinearLayoutManager
import cmsr.ipsacademy.net.adapters.AttendancePanelViewAdapter
import cmsr.ipsacademy.net.api.apiset
import cmsr.ipsacademy.net.api.controller
import cmsr.ipsacademy.net.databinding.FragmentAttendancePanelBinding
import cmsr.ipsacademy.net.databinding.FragmentFacultyAssignedSubjectsBinding
import cmsr.ipsacademy.net.helpers.AppConstants
import cmsr.ipsacademy.net.helpers.SharedPreferencesHelper
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext

class AttendancePanelFragment : Fragment() {
class FacultyAssignedSubjectsFragment : Fragment() {

private var binding: FragmentAttendancePanelBinding? = null
private var binding: FragmentFacultyAssignedSubjectsBinding? = null
private var sharedPreferencesHelper: SharedPreferencesHelper? = null
private lateinit var myAdapter: AttendancePanelViewAdapter

Expand Down Expand Up @@ -68,7 +68,7 @@ class AttendancePanelFragment : Fragment() {
savedInstanceState: Bundle?
): View? {
// Inflate the layout for this fragment
val fragmentBinding = FragmentAttendancePanelBinding.inflate(inflater, container, false)
val fragmentBinding = FragmentFacultyAssignedSubjectsBinding.inflate(inflater, container, false)
binding = fragmentBinding
return fragmentBinding.root
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cmsr.ipsacademy.net.activities.Teacher
package cmsr.ipsacademy.net.activities.teacher.attendence

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,17 @@ import androidx.recyclerview.widget.RecyclerView
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.appcompat.app.AppCompatActivity
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import androidx.fragment.app.FragmentTransaction
import androidx.fragment.app.findFragment
import cmsr.ipsacademy.net.R
import cmsr.ipsacademy.net.activities.MainActivity
import cmsr.ipsacademy.net.activities.models.faculty.subjects.FacultySubjectDetailsModel
import cmsr.ipsacademy.net.activities.models.faculty.subjects.FacultySubjectDetailsModelItem
import cmsr.ipsacademy.net.activities.teacher.attendence.TakeAttendanceFragment
import cmsr.ipsacademy.net.databinding.FragmentTakeAttendanceBinding
import kotlinx.android.synthetic.main.attendance_panel_table_list.view.*

class AttendancePanelViewAdapter(val context: Context): RecyclerView.Adapter<AttendancePanelViewAdapter.RowViewHolder>() {
Expand Down Expand Up @@ -48,6 +56,17 @@ class AttendancePanelViewAdapter(val context: Context): RecyclerView.Adapter<Att
txtDepartment.text = modal.department
txtSubject.text = modal.subject_name
txtSubjectCode.text = modal.university_sub_code

take_attendance_particular_subject_button.setOnClickListener {
val fragment: TakeAttendanceFragment = TakeAttendanceFragment.newInstance()
val activity = it.context as AppCompatActivity
activity.supportFragmentManager.beginTransaction().replace(R.id.frame_layout_container, fragment).addToBackStack(null).commit()


}



}
}

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_hod.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".activities.HOD.HodActivity">
tools:context=".activities.hod.HodActivity">

</androidx.constraintlayout.widget.ConstraintLayout>
10 changes: 1 addition & 9 deletions app/src/main/res/layout/attendance_panel_table_list.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
tools:ignore="RtlCompat">

<TextView
android:id="@+id/take_attendance_particular_subject_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=" Take Attendance "
Expand All @@ -88,15 +89,6 @@
android:text=" Modify "
android:background="#E61010"/>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="5dp"
android:textColor="@color/white"
android:textStyle="bold"
android:text=" Lecture Plan "
android:background="#46b8da"/>

</LinearLayout>

</LinearLayout>
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
android:id="@+id/faculty_attendance_panel"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".activities.Teacher.AttendancePanelFragment">
tools:context=".activities.teacher.attendence.FacultyAssignedSubjectsFragment">

<!-- Table View-->
<HorizontalScrollView
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/fragment_fargment_principal_ui.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"
xmlns:app="http://schemas.android.com/apk/res-auto"
tools:context=".activities.Principal.FragmentPrinciple">
tools:context=".activities.principal.FragmentPrinciple">

<TextView
android:id="@+id/tv"
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/navigation/nav_graph.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
tools:layout="@layout/fragment_class_attendance" />
<fragment
android:id="@+id/faculty_attendance_panel"
android:name="cmsr.ipsacademy.net.activities.Teacher.AttendancePanelFragment"
android:name="cmsr.ipsacademy.net.activities.teacher.attendence.FacultyAssignedSubjectsFragment"
android:label="Attendance Panel"
tools:layout="@layout/fragment_attendance_panel" />
tools:layout="@layout/fragment_faculty_assigned_subjects" />

</navigation>
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ buildscript {
}
dependencies {
classpath "com.android.tools.build:gradle:7.0.4"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.20"
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10'
classpath 'com.google.gms:google-services:4.3.10'

// NOTE: Do not place your application dependencies here; they belong
Expand Down

0 comments on commit 4ef09ab

Please sign in to comment.