<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Форум Александра Климова — Ориентация]]></title>
		<link>http://forum.alexanderklimov.ru/viewtopic.php?id=11</link>
		<atom:link href="http://forum.alexanderklimov.ru/extern.php?action=feed&amp;tid=11&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Ориентация.]]></description>
		<lastBuildDate>Wed, 01 Jan 2020 12:12:08 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Ориентация]]></title>
			<link>http://forum.alexanderklimov.ru/viewtopic.php?pid=1171#p1171</link>
			<description><![CDATA[<p>Добрый день,</p><p>по методам которые вызываются во время поворота экрана написал простенькую программу.<br />но вот странно при повороте отображаются не все события<br />activity xml:<br /></p><div class="codebox"><pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;androidx.constraintlayout.widget.ConstraintLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
    xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;
    xmlns:tools=&quot;http://schemas.android.com/tools&quot;
    android:layout_width=&quot;match_parent&quot;
    android:layout_height=&quot;match_parent&quot;
    tools:context=&quot;.MainActivity&quot;&gt;

    &lt;LinearLayout
        android:layout_width=&quot;match_parent&quot;
        android:layout_height=&quot;match_parent&quot;
        android:orientation=&quot;vertical&quot;
        android:padding=&quot;20dp&quot;
        app:layout_constraintBottom_toBottomOf=&quot;parent&quot;
        app:layout_constraintEnd_toEndOf=&quot;parent&quot;
        app:layout_constraintStart_toStartOf=&quot;parent&quot;
        app:layout_constraintTop_toTopOf=&quot;parent&quot;&gt;

        &lt;TableLayout
            android:layout_width=&quot;match_parent&quot;
            android:layout_height=&quot;wrap_content&quot;&gt;

            &lt;TableRow
                android:layout_width=&quot;match_parent&quot;
                android:layout_height=&quot;match_parent&quot;&gt;

                &lt;CheckBox
                    android:id=&quot;@+id/wasPause&quot;
                    android:layout_width=&quot;wrap_content&quot;
                    android:layout_height=&quot;wrap_content&quot;
                    android:clickable=&quot;false&quot;

                    android:text=&quot;@string/wasPause&quot; /&gt;
            &lt;/TableRow&gt;

            &lt;TableRow
                android:layout_width=&quot;match_parent&quot;
                android:layout_height=&quot;match_parent&quot;&gt;

                &lt;CheckBox
                    android:id=&quot;@+id/wasStop&quot;
                    android:layout_width=&quot;wrap_content&quot;
                    android:layout_height=&quot;wrap_content&quot;
                    android:clickable=&quot;false&quot;

                    android:text=&quot;@string/wasStop&quot; /&gt;
            &lt;/TableRow&gt;

            &lt;TableRow
                android:layout_width=&quot;match_parent&quot;
                android:layout_height=&quot;match_parent&quot;&gt;

                &lt;CheckBox
                    android:id=&quot;@+id/wasDestroy&quot;
                    android:layout_width=&quot;wrap_content&quot;
                    android:layout_height=&quot;wrap_content&quot;
                    android:clickable=&quot;false&quot;

                    android:text=&quot;@string/wasDestroy&quot; /&gt;
            &lt;/TableRow&gt;

            &lt;TableRow
                android:layout_width=&quot;match_parent&quot;
                android:layout_height=&quot;match_parent&quot;&gt;

                &lt;CheckBox
                    android:id=&quot;@+id/wasCreate&quot;
                    android:layout_width=&quot;wrap_content&quot;
                    android:layout_height=&quot;wrap_content&quot;
                    android:clickable=&quot;false&quot;

                    android:text=&quot;@string/wasCreate&quot; /&gt;

            &lt;/TableRow&gt;

            &lt;TableRow
                android:layout_width=&quot;match_parent&quot;
                android:layout_height=&quot;match_parent&quot;&gt;

                &lt;CheckBox
                    android:id=&quot;@+id/wasStart&quot;
                    android:layout_width=&quot;wrap_content&quot;
                    android:layout_height=&quot;wrap_content&quot;
                    android:clickable=&quot;false&quot;

                    android:text=&quot;@string/wasStart&quot; /&gt;
            &lt;/TableRow&gt;

            &lt;TableRow
                android:layout_width=&quot;match_parent&quot;
                android:layout_height=&quot;match_parent&quot;&gt;

                &lt;CheckBox
                    android:id=&quot;@+id/wasResume&quot;
                    android:layout_width=&quot;wrap_content&quot;
                    android:layout_height=&quot;wrap_content&quot;
                    android:clickable=&quot;false&quot;

                    android:text=&quot;@string/wasResume&quot; /&gt;
            &lt;/TableRow&gt;

            &lt;TableRow
                android:layout_width=&quot;match_parent&quot;
                android:layout_height=&quot;match_parent&quot;&gt;

                &lt;CheckBox
                    android:id=&quot;@+id/wasSaveInstanceState&quot;
                    android:layout_width=&quot;wrap_content&quot;
                    android:layout_height=&quot;wrap_content&quot;
                    android:clickable=&quot;false&quot;

                    android:text=&quot;@string/wasSaveInstanceState&quot; /&gt;
            &lt;/TableRow&gt;
        &lt;/TableLayout&gt;

        &lt;Button
            android:id=&quot;@+id/clearBoxes&quot;
            android:layout_width=&quot;match_parent&quot;
            android:layout_height=&quot;wrap_content&quot;
            android:text=&quot;@string/clearBoxes&quot;
            android:onClick=&quot;clearBoxes&quot;/&gt;

    &lt;/LinearLayout&gt;

&lt;/androidx.constraintlayout.widget.ConstraintLayout&gt;</code></pre></div><p>Activity class:<br /></p><div class="codebox"><pre><code>import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;
import android.widget.CheckBox;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        CheckBox mBox = findViewById(R.id.wasCreate);
        mBox.setChecked(true);
    }

    @Override
    protected void onStop() {
        super.onStop();

        CheckBox mBox = findViewById(R.id.wasStop);
        mBox.setChecked(true);
    }

    @Override
    protected void onPause() {
        super.onPause();

        CheckBox mBox = findViewById(R.id.wasPause);
        mBox.setChecked(true);
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();

        CheckBox mBox = findViewById(R.id.wasDestroy);
        mBox.setChecked(true);
    }

    @Override
    protected void onStart() {
        super.onStart();

        CheckBox mBox = findViewById(R.id.wasStart);
        mBox.setChecked(true);
    }

    @Override
    protected void onResume() {
        super.onResume();

        CheckBox mBox = findViewById(R.id.wasResume);
        mBox.setChecked(true);
    }

    @Override
    protected void onSaveInstanceState(@NonNull Bundle outState) {
        super.onSaveInstanceState(outState);

        CheckBox mBox = findViewById(R.id.wasSaveInstanceState);
        mBox.setChecked(true);
    }

    public void clearBoxes(View view) {

        int idBoxes[] = { R.id.wasSaveInstanceState,
                R.id.wasPause, R.id.wasDestroy,
                R.id.wasCreate,R.id.wasResume,
                R.id.wasStart, R.id.wasStop};

        for (int idBox: idBoxes) {
            CheckBox mBox = findViewById(idBox);
            mBox.setChecked(false);
        }
    }
}</code></pre></div><p>А в результате только это после поворота:<br /><span class="postimg"><img src="https://a.radikal.ru/a01/2001/c8/14845e85ddf9.png" alt="screen" /></span><br />Почему так?</p>]]></description>
			<author><![CDATA[null@example.com (dmitrybarynov)]]></author>
			<pubDate>Wed, 01 Jan 2020 12:12:08 +0000</pubDate>
			<guid>http://forum.alexanderklimov.ru/viewtopic.php?pid=1171#p1171</guid>
		</item>
		<item>
			<title><![CDATA[Re: Ориентация]]></title>
			<link>http://forum.alexanderklimov.ru/viewtopic.php?pid=1073#p1073</link>
			<description><![CDATA[<p>Здравствуйте!<br />У меня возникла такая проблема при повороте экрана на 90 и -90 градусов, все поворачивается нормально. Но когда поворачиваю на 180 градусов ориентация экрана не меняется. В чем проблема?</p>]]></description>
			<author><![CDATA[null@example.com (aganinrinat)]]></author>
			<pubDate>Mon, 12 Mar 2018 22:28:23 +0000</pubDate>
			<guid>http://forum.alexanderklimov.ru/viewtopic.php?pid=1073#p1073</guid>
		</item>
		<item>
			<title><![CDATA[Re: Ориентация]]></title>
			<link>http://forum.alexanderklimov.ru/viewtopic.php?pid=1057#p1057</link>
			<description><![CDATA[<p>Это точно работает на планшете Nexus 2013, только 90 и -90 работают наоборот. Другая система отсчета. А на телефонах и эмуляторах действительно у большинства это не сработает. Поэтому не стоит полагаться на этот код.</p>]]></description>
			<author><![CDATA[null@example.com (alexander.klimoff)]]></author>
			<pubDate>Tue, 06 Feb 2018 20:15:46 +0000</pubDate>
			<guid>http://forum.alexanderklimov.ru/viewtopic.php?pid=1057#p1057</guid>
		</item>
		<item>
			<title><![CDATA[Re: Ориентация]]></title>
			<link>http://forum.alexanderklimov.ru/viewtopic.php?pid=1056#p1056</link>
			<description><![CDATA[<div class="quotebox"><cite>alexander.klimoff wrote:</cite><blockquote><p>Возможно, телефон не поддерживает.</p></blockquote></div><p>Возможно, но я перепробовал смартфон и несколько эмуляторов.</p>]]></description>
			<author><![CDATA[null@example.com (dimabuslaev)]]></author>
			<pubDate>Tue, 06 Feb 2018 12:45:01 +0000</pubDate>
			<guid>http://forum.alexanderklimov.ru/viewtopic.php?pid=1056#p1056</guid>
		</item>
		<item>
			<title><![CDATA[Re: Ориентация]]></title>
			<link>http://forum.alexanderklimov.ru/viewtopic.php?pid=1053#p1053</link>
			<description><![CDATA[<p>Возможно, телефон не поддерживает.</p>]]></description>
			<author><![CDATA[null@example.com (alexander.klimoff)]]></author>
			<pubDate>Wed, 24 Jan 2018 10:45:15 +0000</pubDate>
			<guid>http://forum.alexanderklimov.ru/viewtopic.php?pid=1053#p1053</guid>
		</item>
		<item>
			<title><![CDATA[Re: Ориентация]]></title>
			<link>http://forum.alexanderklimov.ru/viewtopic.php?pid=1046#p1046</link>
			<description><![CDATA[<p>Здравствуйте! <br />Почему getRotation не правильно определяется? <br />При повороте вправо выдается: &quot;повернули на 90 градусов против часовой стрелки&quot;, тоже самое при любом другом положении, кроме default.</p><p>Вот код:</p><p>package ru.buslay.rotateme;</p><p>import android.content.res.Configuration;<br />import android.support.v7.app.AppCompatActivity;<br />import android.os.Bundle;<br />import android.view.Surface;<br />import android.view.View;<br />import android.widget.Toast;</p><p>public class MainActivity extends AppCompatActivity {<br />&nbsp; &nbsp; @Override<br />&nbsp; &nbsp; protected void onCreate(Bundle savedInstanceState) {<br />&nbsp; &nbsp; &nbsp; &nbsp; super.onCreate(savedInstanceState);<br />&nbsp; &nbsp; &nbsp; &nbsp; setContentView(R.layout.activity_main);</p><p>&nbsp; &nbsp; }</p><p>&nbsp; &nbsp; private String getScreenOrientation(){<br />&nbsp; &nbsp; &nbsp; &nbsp; if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return &quot;Портретная ориентация&quot;;<br />&nbsp; &nbsp; &nbsp; &nbsp; else if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return &quot;Альбомная ориентация&quot;;<br />&nbsp; &nbsp; &nbsp; &nbsp; else<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return &quot;&quot;;<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; private String getRotateOrientation() {<br />&nbsp; &nbsp; &nbsp; &nbsp; int rotate = getWindowManager().getDefaultDisplay().getRotation();</p><p>&nbsp; &nbsp; &nbsp; &nbsp; switch (rotate){<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case Surface.ROTATION_0:<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return &quot;Не поворачивали&quot;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case Surface.ROTATION_90:<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return &quot;Повернули на 90 градусов по часовой стрелке&quot;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case Surface.ROTATION_180:<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return &quot;Повернули на 180 градусов&quot;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case Surface.ROTATION_270:<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return &quot;Повернули на 90 градусов против часовой стрелки&quot;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; default:<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return &quot;Не понятно&quot;;<br />&nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; }</p><p>&nbsp; &nbsp; public void push(View view) {<br />&nbsp; &nbsp; &nbsp; &nbsp; Toast toast = Toast.makeText(getApplicationContext(),getScreenOrientation(),Toast.LENGTH_SHORT);<br />&nbsp; &nbsp; &nbsp; &nbsp; toast.show();<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; public void pushItReal(View view){<br />&nbsp; &nbsp; &nbsp; &nbsp; Toast toast = Toast.makeText(getApplicationContext(),getRotateOrientation(),Toast.LENGTH_LONG);<br />&nbsp; &nbsp; &nbsp; &nbsp; toast.show();<br />&nbsp; &nbsp; }<br />}</p>]]></description>
			<author><![CDATA[null@example.com (dimabuslaev)]]></author>
			<pubDate>Sun, 21 Jan 2018 14:12:30 +0000</pubDate>
			<guid>http://forum.alexanderklimov.ru/viewtopic.php?pid=1046#p1046</guid>
		</item>
		<item>
			<title><![CDATA[Re: Ориентация]]></title>
			<link>http://forum.alexanderklimov.ru/viewtopic.php?pid=982#p982</link>
			<description><![CDATA[<p>Нет. Добавьте кнопку в разметку и в режиме Design посмотрите у кнопки атрибут Style. Кнопка может быть разной внешне.</p>]]></description>
			<author><![CDATA[null@example.com (alexander.klimoff)]]></author>
			<pubDate>Thu, 16 Nov 2017 14:46:56 +0000</pubDate>
			<guid>http://forum.alexanderklimov.ru/viewtopic.php?pid=982#p982</guid>
		</item>
		<item>
			<title><![CDATA[Re: Ориентация]]></title>
			<link>http://forum.alexanderklimov.ru/viewtopic.php?pid=981#p981</link>
			<description><![CDATA[<div class="quotebox"><cite>alexander.klimoff wrote:</cite><blockquote><p>Это не ошибка (иначе бы не запустилось), а предупреждение. Просто советуют поменять стиль кнопки. Если вас устраивает, то оставляйте.</p></blockquote></div><p>Вы об этом<br />---<br />Отдельно стоит отметить создание стиля для кнопки. У кнопки есть несколько состояний - обычное, в фокусе, нажатое, нажатое с фокусом. Поэтому для кнопки нужно создать четыре отдельных стиля, чтобы кнопка выглядела профессионально.<br />----<br />??</p>]]></description>
			<author><![CDATA[null@example.com (kirill_nn)]]></author>
			<pubDate>Thu, 16 Nov 2017 12:34:24 +0000</pubDate>
			<guid>http://forum.alexanderklimov.ru/viewtopic.php?pid=981#p981</guid>
		</item>
		<item>
			<title><![CDATA[Re: Ориентация]]></title>
			<link>http://forum.alexanderklimov.ru/viewtopic.php?pid=977#p977</link>
			<description><![CDATA[<p>Это ничем не отличается от вашего mConstraintLayout.setBackgroundColor(getResources().getColor(R.color.colorRed));</p>]]></description>
			<author><![CDATA[null@example.com (alexander.klimoff)]]></author>
			<pubDate>Tue, 14 Nov 2017 17:21:00 +0000</pubDate>
			<guid>http://forum.alexanderklimov.ru/viewtopic.php?pid=977#p977</guid>
		</item>
		<item>
			<title><![CDATA[Re: Ориентация]]></title>
			<link>http://forum.alexanderklimov.ru/viewtopic.php?pid=974#p974</link>
			<description><![CDATA[<p>2 alexander.klimoff спасибо! Прочитаю обязательно. Пока сделал через &quot;костылик&quot;</p><p>import android.app.Activity;<br />import android.os.Bundle;<br />import android.support.constraint.ConstraintLayout;<br />import android.view.View;<br />import android.widget.TextView;</p><p>public class light extends Activity {<br />&nbsp; &nbsp; private ConstraintLayout mConstraintLayout;<br />&nbsp; &nbsp; private TextView mInfoTextView;<br />&nbsp; &nbsp; private static final String KEY_COLOR = &quot;COLOR&quot;;<br />&nbsp; &nbsp; private static String COLOR_STRING_SAVE = &quot;&quot;;</p><p>&nbsp; &nbsp; @Override<br />&nbsp; &nbsp; protected void onCreate(Bundle savedInstanceState) {<br />&nbsp; &nbsp; &nbsp; &nbsp; super.onCreate(savedInstanceState);<br />&nbsp; &nbsp; &nbsp; &nbsp; setContentView(R.layout.activity_light);<br />&nbsp; &nbsp; &nbsp; &nbsp; mConstraintLayout = findViewById(R.id.layout);<br />&nbsp; &nbsp; &nbsp; &nbsp; mInfoTextView = findViewById(R.id.textView);<br />&nbsp; &nbsp; &nbsp; &nbsp; if (savedInstanceState != null) {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (savedInstanceState.getString(KEY_COLOR, COLOR_STRING_SAVE).equals(&quot;red&quot;)) {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; red();<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } else if (savedInstanceState.getString(KEY_COLOR, COLOR_STRING_SAVE).equals(&quot;yellow&quot;)) {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; yellow();<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } else if (savedInstanceState.getString(KEY_COLOR, COLOR_STRING_SAVE).equals(&quot;green&quot;)) {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; green();<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } else { //for savedInstanceState error<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; red();<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; } else {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; red();<br />&nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; }</p><p>&nbsp; &nbsp; public void onButtonRedClick(View view) {<br />&nbsp; &nbsp; &nbsp; &nbsp; red();<br />&nbsp; &nbsp; }</p><p>&nbsp; &nbsp; public void onButtonYellowClick(View view) {<br />&nbsp; &nbsp; &nbsp; &nbsp; yellow();<br />&nbsp; &nbsp; }</p><p>&nbsp; &nbsp; public void onButtonGreenClick(View view) {<br />&nbsp; &nbsp; &nbsp; &nbsp; green();<br />&nbsp; &nbsp; }</p><p>&nbsp; &nbsp; public void red() {<br />&nbsp; &nbsp; &nbsp; &nbsp; mInfoTextView.setText(R.string.buttonRed);<br />&nbsp; &nbsp; &nbsp; &nbsp; mConstraintLayout.setBackgroundColor(getResources().getColor(R.color.colorRed));<br />&nbsp; &nbsp; &nbsp; &nbsp; COLOR_STRING_SAVE = &quot;red&quot;;<br />&nbsp; &nbsp; }</p><p>&nbsp; &nbsp; public void yellow() {<br />&nbsp; &nbsp; &nbsp; &nbsp; mInfoTextView.setText(R.string.buttonYellow);<br />&nbsp; &nbsp; &nbsp; &nbsp; mConstraintLayout.setBackgroundColor(getResources().getColor(R.color.colorYellow));<br />&nbsp; &nbsp; &nbsp; &nbsp; COLOR_STRING_SAVE = &quot;yellow&quot;;<br />&nbsp; &nbsp; }</p><p>&nbsp; &nbsp; public void green() {<br />&nbsp; &nbsp; &nbsp; &nbsp; mInfoTextView.setText(R.string.buttonGreen);<br />&nbsp; &nbsp; &nbsp; &nbsp; mConstraintLayout.setBackgroundColor(getResources().getColor(R.color.colorGreen));<br />&nbsp; &nbsp; &nbsp; &nbsp; COLOR_STRING_SAVE = &quot;green&quot;;<br />&nbsp; &nbsp; }</p><p>&nbsp; &nbsp; @Override<br />&nbsp; &nbsp; protected void onSaveInstanceState(Bundle outState) {<br />&nbsp; &nbsp; &nbsp; &nbsp; super.onSaveInstanceState(outState);<br />&nbsp; &nbsp; &nbsp; &nbsp; outState.putString(KEY_COLOR, COLOR_STRING_SAVE);<br />&nbsp; &nbsp; }<br />}</p><p>Прочитал.<br />Вы про способ</p><p>int myRedColor = activity.getResourses.getColor(R.color.red); // получаем значение красного цвета</p><p>Запомнить цвет как Int?? интересненько... нада запомнить :-)<br />PS никогда не думал, что просто переворот девайса - это куча алгоритмов, и действий :-)<br />А мне кстати мой&nbsp; способ через &quot;костылик&quot; нравиться :-)</p>]]></description>
			<author><![CDATA[null@example.com (kirill_nn)]]></author>
			<pubDate>Tue, 14 Nov 2017 13:02:05 +0000</pubDate>
			<guid>http://forum.alexanderklimov.ru/viewtopic.php?pid=974#p974</guid>
		</item>
		<item>
			<title><![CDATA[Re: Ориентация]]></title>
			<link>http://forum.alexanderklimov.ru/viewtopic.php?pid=973#p973</link>
			<description><![CDATA[<p><a href="http://developer.alexanderklimov.ru/android/theory/resources.php#color">http://developer.alexanderklimov.ru/and … .php#color</a></p>]]></description>
			<author><![CDATA[null@example.com (alexander.klimoff)]]></author>
			<pubDate>Tue, 14 Nov 2017 10:05:11 +0000</pubDate>
			<guid>http://forum.alexanderklimov.ru/viewtopic.php?pid=973#p973</guid>
		</item>
		<item>
			<title><![CDATA[Re: Ориентация]]></title>
			<link>http://forum.alexanderklimov.ru/viewtopic.php?pid=972#p972</link>
			<description><![CDATA[<p>А как сохранить ресурс?? что бы при смене Ориентации экрана сохранялся цвет фона??<br />С текстом кнопки разобрался... а вот что делать с цветом фона, придумать не могу...<br />Переделываю Светофор под &quot;повороты экрана&quot; :-)<br /><a href="https://github.com/KirillNN/TrafficLight">https://github.com/KirillNN/TrafficLight</a></p><p>public class light extends Activity {<br />&nbsp; &nbsp; private ConstraintLayout mConstraintLayout;<br />&nbsp; &nbsp; private TextView mInfoTextView;<br />&nbsp; &nbsp; private static final String KEY_COLOR = &quot;COLOR&quot;;<br />&nbsp; &nbsp; private static final String KEY_BUTTON = &quot;BUTTON&quot;;<br />&nbsp; &nbsp; private static String COLOR_STRING_SAVE = &quot;&quot;;</p><p>&nbsp; &nbsp; @Override<br />&nbsp; &nbsp; protected void onCreate(Bundle savedInstanceState) {<br />&nbsp; &nbsp; &nbsp; &nbsp; super.onCreate(savedInstanceState);<br />&nbsp; &nbsp; &nbsp; &nbsp; setContentView(R.layout.activity_light);<br />&nbsp; &nbsp; &nbsp; &nbsp; mConstraintLayout = findViewById(R.id.layout);<br />&nbsp; &nbsp; &nbsp; &nbsp; mInfoTextView = findViewById(R.id.textView);<br />&nbsp; &nbsp; &nbsp; &nbsp; mConstraintLayout.setBackgroundColor(getResources().getColor(R.color.colorRed));<br />&nbsp; &nbsp; &nbsp; &nbsp; if (savedInstanceState != null) {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mInfoTextView.setText(savedInstanceState.getString(KEY_COLOR, COLOR_STRING_SAVE));<br />&nbsp; &nbsp; &nbsp; &nbsp; } else {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mInfoTextView.setText(R.string.buttonRed);<br />&nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; }</p><p>&nbsp; &nbsp; public void onButtonRedClick(View view) {<br />&nbsp; &nbsp; &nbsp; &nbsp; mInfoTextView.setText(R.string.buttonRed);<br />&nbsp; &nbsp; &nbsp; &nbsp; mConstraintLayout.setBackgroundColor(getResources().getColor(R.color.colorRed));<br />&nbsp; &nbsp; }</p><p>&nbsp; &nbsp; public void onButtonYellowClick(View view) {<br />&nbsp; &nbsp; &nbsp; &nbsp; mInfoTextView.setText(R.string.buttonYellow);<br />&nbsp; &nbsp; &nbsp; &nbsp; mConstraintLayout.setBackgroundColor(getResources().getColor(R.color.colorYellow));<br />&nbsp; &nbsp; }</p><p>&nbsp; &nbsp; public void onButtonGreenClick(View view) {<br />&nbsp; &nbsp; &nbsp; &nbsp; mInfoTextView.setText(R.string.buttonGreen);<br />&nbsp; &nbsp; &nbsp; &nbsp; mConstraintLayout.setBackgroundColor(getResources().getColor(R.color.colorGreen));<br />&nbsp; &nbsp; }</p><p>&nbsp; &nbsp; @Override<br />&nbsp; &nbsp; protected void onSaveInstanceState(Bundle outState) {<br />&nbsp; &nbsp; &nbsp; &nbsp; super.onSaveInstanceState(outState);<br />&nbsp; &nbsp; &nbsp; &nbsp; COLOR_STRING_SAVE = mInfoTextView.getText().toString();<br />&nbsp; &nbsp; &nbsp; &nbsp; outState.putString(KEY_BUTTON, COLOR_STRING_SAVE);</p><p>&nbsp; &nbsp; }<br />}</p>]]></description>
			<author><![CDATA[null@example.com (kirill_nn)]]></author>
			<pubDate>Tue, 14 Nov 2017 09:07:34 +0000</pubDate>
			<guid>http://forum.alexanderklimov.ru/viewtopic.php?pid=972#p972</guid>
		</item>
		<item>
			<title><![CDATA[Re: Ориентация]]></title>
			<link>http://forum.alexanderklimov.ru/viewtopic.php?pid=968#p968</link>
			<description><![CDATA[<p>Это не ошибка (иначе бы не запустилось), а предупреждение. Просто советуют поменять стиль кнопки. Если вас устраивает, то оставляйте.</p>]]></description>
			<author><![CDATA[null@example.com (alexander.klimoff)]]></author>
			<pubDate>Mon, 13 Nov 2017 10:53:55 +0000</pubDate>
			<guid>http://forum.alexanderklimov.ru/viewtopic.php?pid=968#p968</guid>
		</item>
		<item>
			<title><![CDATA[Re: Ориентация]]></title>
			<link>http://forum.alexanderklimov.ru/viewtopic.php?pid=967#p967</link>
			<description><![CDATA[<p>Начинаю делать данный урок... Создал Landskape ориентацию... скопировал код... вернул, что бы создать автоматом в Andriod Studio Создал автоматом, долго копался, как все таки расставить кнопки, как я хочу (без копирования когда), расставил<br />Выдает ошибку - button should be borderless, нор при этом, все отлично работает, отображается как я хочу...<br />Если не трудно объясните что не так...<br /><a href="https://github.com/KirillNN/Orienration">https://github.com/KirillNN/Orienration</a><br />Заранее благодарен :-)</p>]]></description>
			<author><![CDATA[null@example.com (kirill_nn)]]></author>
			<pubDate>Sun, 12 Nov 2017 06:39:23 +0000</pubDate>
			<guid>http://forum.alexanderklimov.ru/viewtopic.php?pid=967#p967</guid>
		</item>
		<item>
			<title><![CDATA[Re: Ориентация]]></title>
			<link>http://forum.alexanderklimov.ru/viewtopic.php?pid=863#p863</link>
			<description><![CDATA[<p>Уроки существуют уже пять лет и по ним выучилось тысячи человек. Если у вас что-то не получается, значит вы что-то не так делаете. Я не экстрасенс и определить ваши ошибки по вашим сообщениям не в состоянии. Можете описать свою проблему в письме, попробуем разобраться.</p>]]></description>
			<author><![CDATA[null@example.com (alexander.klimoff)]]></author>
			<pubDate>Sat, 05 Aug 2017 09:49:02 +0000</pubDate>
			<guid>http://forum.alexanderklimov.ru/viewtopic.php?pid=863#p863</guid>
		</item>
	</channel>
</rss>
