CompassFragment.java 文件源码

java
阅读 26 收藏 0 点赞 0 评论 0

项目:MuslimMateAndroid 作者:
private void init(View view) {

        countryName = (TextView) view.findViewById(R.id.textView11);
        if( MainActivity.locationInfo != null)
            countryName.setText(getResources().getConfiguration().locale.getDisplayLanguage()
                    .equals("العربية") ? ConfigPreferences.getLocationConfig(getContext()).name_english :
                    ConfigPreferences.getLocationConfig(getContext()).name);
        Quibladegree = (TextView) view.findViewById(R.id.textView12);
        Quibladegree.setText("Qibla direction from North: "+ ConfigPreferences.getQuibla(getContext()));
        indicator = (ImageView) view.findViewById(R.id.imageView2);
        compass = (RelativeLayout) view.findViewById(R.id.compassContainer);
        mSensorManager = (SensorManager) getContext().getSystemService(getContext().SENSOR_SERVICE);
        RotateAnimation ra = new RotateAnimation(currentDegree, MainActivity.quiblaDegree,
                Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
        ra.setDuration(400);
        ra.setFillAfter(true);
        indicator.startAnimation(ra);

    }
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号