I am using ProgressBar in my application. It is working fine in all Versions in all Mobiles. But when I checked it in Samsung Galaxy S4 with version 4.4.2, It is not showing proper height as compared to other mobiles.
Same Issue with PopupWindow, It is not showing Proper size only in Samsung Galaxy S4 with version 4.4.2. I google for this but din't get any result related to this.
But I found that there is an update Issue of 4.4.2 in Samsung Galaxy S4. Is this can be a real issue ???
Note : It is working fine in version 4.4.2 of other Mobiles.
Code :
Progressbar :
Display display = ((WindowManager) getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
@SuppressWarnings("deprecation")
int ratio = ((int) display.getWidth() / 100)* value;
((ProgressBar) view).setProgress(ratio);
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(ratio, 35);
((ProgressBar) view).setLayoutParams(params);
PopupWindow :
private void initiatePopupWindow() {
try {
LayoutInflater inflater = (LayoutInflater) getActivity()
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
final View layout = inflater.inflate(R.layout.vocabmaster_home,
(ViewGroup) getActivity().findViewById(R.id.popup_element));
pwindo = new PopupWindow(layout, 380, 580, true);
new Handler().postDelayed(new Runnable() {
public void run() {
pwindo.showAtLocation(layout, Gravity.CENTER, 0, 0);
}
}, 500);
btnClosePopUp = (Button) layout.findViewById(R.id.btn_close_popup);
btnClosePopUp.setOnClickListener(cancel_button_click_listener);
tvWord = (TextView) layout.findViewById(R.id.tvWord);
tvWordMeaning = (TextView) layout.findViewById(R.id.tvWordMeaning);
imgNext = (ImageView) layout.findViewById(R.id.imgNext);
imgNext.setOnClickListener(imgNext_click_listener);
imgPrev = (ImageView) layout.findViewById(R.id.imgPrev);
imgPrev.setOnClickListener(imgPrev_click_listener);
imgDictionary = (ImageView) layout.findViewById(R.id.imgDictionary);
imgDictionary.setOnClickListener(imgDictionary_click_listener);
ConnectionAdapter_Vocab dbCon = new ConnectionAdapter_Vocab(
getActivity());
dbCon.createDatabase();
dbCon.open();
Cursor curVocab = dbCon.getWord();
String Word = curVocab.getString(curVocab.getColumnIndex("Word"));
String WordMeaning = curVocab.getString(curVocab
.getColumnIndex("Meaning"));
Word1 = Word;
WordId = curVocab.getString(curVocab.getColumnIndex("WordId"));
dbCon.close();
((TextView) tvWord).setText(Html.fromHtml(Word));
((TextView) tvWordMeaning).setText(Html.fromHtml(WordMeaning));
imgPrev.setEnabled(false);
} catch (Exception e) {
e.printStackTrace();
}
}
Sample Image for ProgressBar:
0 comments:
Post a Comment