0


I have a calendar view which is based on a GridView.
It basically a school tests calendar. When you click on one of the cells you can see information about the test. In some phones the TextView containing the information is not shown, or partially shown because the calendar catches the whole screen. I decided that if the TextView is cut off, I want to show an AlertDialog instead of showing the information on the screen. The problem is, I don't know how to check if the TextView is cut off.
Here are 2 pictures to show you what I mean:

Thats how it should look:

Thats how it should look

Thats how it sometimes looks:

Thats how it sometimes looks

Thanks!

RE6
  • 2,684
  • 4
  • 31
  • 57
  • Can you post the layout? I don't see the `TextView` overlapping, its text is cut off. – user Sep 15 '12 at 08:26

2 Answers2

0

You can find out what is screen size category (small, medium ...) see here, and then can have different behavior for different screen sizes. In your case you can show AlertDialog in case of small or medium size screens.

Community
  • 1
  • 1
Naresh
  • 36
  • 2
  • I don't want it to be absolute. also, because it is a calendar, and the number of days is not pernament, sometimes it is cut and sometimes not – RE6 Sep 15 '12 at 08:36
0

I have found a solution on my own. I checked the height of the GridView and the height of the TextView. then,

if (gridViewHeight + textViewHeight >= containingLinearLayoutHeight)

it means that the Text is cut off.

RE6
  • 2,684
  • 4
  • 31
  • 57