Skip to content

Commit

Permalink
Remove previous tab menu layout
Browse files Browse the repository at this point in the history
  • Loading branch information
avazirna committed Dec 16, 2024
1 parent b12e6e3 commit 5e0945e
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 124 deletions.
40 changes: 0 additions & 40 deletions app/res/drawable/title_case_tab_vertical.xml

This file was deleted.

45 changes: 0 additions & 45 deletions app/res/drawable/title_neutral_tab_vertical.xml

This file was deleted.

7 changes: 0 additions & 7 deletions app/res/layout/tabbed_detail_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,6 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
tools:viewBindingIgnore="true">

<LinearLayout
android:id="@+id/tabbed_detail_menu"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
</LinearLayout>

<LinearLayout
android:id="@+id/tabbed_detail_pager_wrapper"
android:layout_width="match_parent"
Expand Down
1 change: 0 additions & 1 deletion app/src/org/commcare/activities/EntityDetailActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ public void onCreateSessionSafe(Bundle savedInstanceState) {
mDetailView.setRoot(container.findViewById(R.id.entity_detail_tabs));
mDetailView.refresh(detail, mTreeReference, detailIndex);

mDetailView.showMenu();
isFinalSwipeActionEnabled = DeveloperPreferences.isDetailTabSwipeActionEnabled();
}

Expand Down
1 change: 0 additions & 1 deletion app/src/org/commcare/activities/EntitySelectActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -967,7 +967,6 @@ private void displayReferenceAwesome(final TreeReference selection, int detailIn

Detail detail = session.getDetail(selectedIntent.getStringExtra(EntityDetailActivity.DETAIL_ID));
factory = new NodeEntityFactory(detail, session.getEvaluationContext(new AndroidInstanceInitializer(session)));
detailView.showMenu();

if (detail.isCompound()) {
// border around right panel doesn't look right when there are tabs
Expand Down
1 change: 0 additions & 1 deletion app/src/org/commcare/fragments/BreadcrumbBarFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,6 @@ public void expandInlineTile(AppCompatActivity activity, View holder,
CommCareSession session = asw.getSession();

Detail detail = session.getDetail(inlineDetailId);
mInternalDetailView.showMenu();
mInternalDetailView.refresh(detail, tileData.second, 0);
}
expand(activity, holder.findViewById(R.id.com_tile_holder_detail_master));
Expand Down
35 changes: 6 additions & 29 deletions app/src/org/commcare/views/TabbedDetailView.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,21 @@
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;

import androidx.appcompat.app.AppCompatActivity;
import androidx.viewpager2.widget.ViewPager2;

import com.google.android.material.tabs.TabLayout;
import com.google.android.material.tabs.TabLayoutMediator;

import org.commcare.adapters.EntityDetailPagerAdapter;
import org.commcare.adapters.ListItemViewStriper;
import org.commcare.dalvik.R;
import org.commcare.suite.model.Detail;
import org.commcare.utils.AndroidUtil;
import org.javarosa.core.model.instance.TreeReference;

import androidx.appcompat.app.AppCompatActivity;
import androidx.viewpager2.widget.ViewPager2;

import com.google.android.material.tabs.TabLayout;
import com.google.android.material.tabs.TabLayoutMediator;

import java.util.Objects;

/**
Expand All @@ -32,8 +31,6 @@
*/
public class TabbedDetailView extends RelativeLayout {
private AppCompatActivity mContext;

private LinearLayout mMenu;
private TabLayout mTabLayout;
private ViewPager2 mViewPager;

Expand Down Expand Up @@ -75,17 +72,11 @@ public void setRoot(ViewGroup root) {

inflater.inflate(R.layout.tabbed_detail_view, root, true);

mMenu = root.findViewById(R.id.tabbed_detail_menu);
mViewPager = root.findViewById(R.id.tabbed_detail_pager);
mViewPager.setId(AndroidUtil.generateViewId());

mTabLayout = root.findViewById(R.id.tab_layout);
}

public void showMenu() {
mMenu.setVisibility(VISIBLE);
}

/**
* Get form list from database and insert into view.
*/
Expand All @@ -102,20 +93,6 @@ public void refresh(Detail detail, TreeReference reference, int index) {
}
}

/**
* Style one tab as "selected".
*/
private void markSelectedTab(int position) {
if (mMenu.getChildCount() <= position) {
return;
}

for (int i = 0; i < mMenu.getChildCount(); i++) {
mMenu.getChildAt(i).setBackgroundDrawable(getResources().getDrawable(R.drawable.title_neutral_tab_vertical));
}
mMenu.getChildAt(position).setBackgroundDrawable(getResources().getDrawable(R.drawable.title_case_tab_vertical));
}

public int getCurrentTab() {
return mViewPager.getCurrentItem();
}
Expand Down

0 comments on commit 5e0945e

Please sign in to comment.